コード例 #1
0
ファイル: FileManagerAbstract.php プロジェクト: zaxxx/zaxcms
 /**
  * @return string
  * @throws InvalidPathException
  */
 public function getAbsoluteDirectory()
 {
     $dir = realpath($this->getRoot() . $this->getDirectory());
     if (!(Zax\Utils\PathHelpers::isSubdirOf($this->getRoot(), $dir) || Zax\Utils\PathHelpers::isEqual($this->getRoot(), $dir))) {
         throw new InvalidPathException('Outside of allowed folder - ' . $dir . ' is not inside ' . $this->getRoot());
     }
     return $dir;
 }
コード例 #2
0
ファイル: FileManagerControl.php プロジェクト: zaxxx/zaxcms
 public function isRootSelected()
 {
     $dir = realpath($this->getRoot() . $this->getDirectory());
     return Zax\Utils\PathHelpers::isEqual($this->getRoot(), $dir);
 }