Also return false for validation if the path is shorter than the root path

master
Sven Slootweg 12 years ago
parent 8c1b3464ff
commit a3ca2ffcfb

@ -20,6 +20,8 @@ class PathValidator
$root_path = $this->ParsePath($root); $root_path = $this->ParsePath($root);
if($root_path != null) if($root_path != null)
{
if($this->RelativeDepth($root) >= 0)
{ {
$root_stack = explode("/", $root_path); $root_stack = explode("/", $root_path);
$path_stack = explode("/", $this->path); $path_stack = explode("/", $this->path);
@ -35,6 +37,11 @@ class PathValidator
return true; return true;
} }
else else
{
return false;
}
}
else
{ {
throw new Exception("Specified root path is invalid."); throw new Exception("Specified root path is invalid.");
} }

Loading…
Cancel
Save