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

master
Sven Slootweg 12 years ago
parent 8c1b3464ff
commit a3ca2ffcfb

@ -21,18 +21,25 @@ class PathValidator
if($root_path != null) if($root_path != null)
{ {
$root_stack = explode("/", $root_path); if($this->RelativeDepth($root) >= 0)
$path_stack = explode("/", $this->path);
for($i = 0; $i < count($root_stack); $i++)
{ {
if($root_stack[$i] != $path_stack[$i]) $root_stack = explode("/", $root_path);
$path_stack = explode("/", $this->path);
for($i = 0; $i < count($root_stack); $i++)
{ {
return false; if($root_stack[$i] != $path_stack[$i])
{
return false;
}
} }
return true;
}
else
{
return false;
} }
return true;
} }
else else
{ {

Loading…
Cancel
Save