You are here

private function FMDiskFileSystem::getRelativePath in N1ED - Visual editor as CKEditor plugin with Bootstrap support 7

1 call to FMDiskFileSystem::getRelativePath()
FMDiskFileSystem::getAbsolutePath in vendor/edsdk/flmngr-server-php/src/fs/FMDiskFileSystem.php

File

vendor/edsdk/flmngr-server-php/src/fs/FMDiskFileSystem.php, line 88

Class

FMDiskFileSystem

Namespace

EdSDK\FlmngrServer\fs

Code

private function getRelativePath($path) {
  if (strpos($path, "..") !== FALSE) {
    throw new MessageException(FMMessage::createMessage(FMMessage::FM_DIR_NAME_CONTAINS_INVALID_SYMBOLS));
  }
  if (strpos($path, '/') !== 0) {
    $path = '/' . $path;
  }
  $rootDirName = $this
    ->getRootDirName();
  if (strpos($path, "/" . $rootDirName) !== 0) {
    throw new MessageException(FMMessage::createMessage(FMMessage::FM_DIR_NAME_INCORRECT_ROOT));
  }
  return substr($path, strlen("/" . $rootDirName));
}