/** * @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; }
public function isRootSelected() { $dir = realpath($this->getRoot() . $this->getDirectory()); return Zax\Utils\PathHelpers::isEqual($this->getRoot(), $dir); }