30 $this->_allowCreateFolders = (bool)$flag;
40 public function open(array $args = [])
64 $path = trim(preg_replace(
"/\\\\/",
"/", (
string)
$path));
66 if (!preg_match(
"/(\.\w{1,4})$/",
$path) && !preg_match(
"/\?[^\\/]+$/",
$path) && !preg_match(
"/\\/$/",
$path)
72 $pattern =
"/^(\\/|\w:\\/|https?:\\/\\/[^\\/]+\\/)?(.*)$/i";
75 $pathTokR = $matches[0][1];
76 $pathTokP = $matches[0][2];
78 $pathTokP = preg_replace([
"/^\\/+/",
"/\\/+/"], [
"",
"/"], $pathTokP);
80 $pathParts = explode(
"/", $pathTokP);
83 for (
$i = 0, $realPathParts = [];
$i < count($pathParts);
$i++) {
84 if ($pathParts[
$i] ==
'.') {
87 if (isset($realPathParts[0]) && $realPathParts[0] !=
'..' || $pathTokR !=
"") {
88 array_pop($realPathParts);
93 $realPathParts[] = $pathParts[
$i];
96 return $pathTokR . implode(
'/', $realPathParts);
elseif(isset( $params[ 'redirect_parent']))
setAllowCreateFolders($flag)
allowedPath($haystackPath, $needlePath)