Check for string position instead of string existence
otherwise /foo/bar would be detected as a subfolder of /bar THX @icewind1991
This commit is contained in:
parent
b7db967dc5
commit
99adfbdb86
|
@ -633,7 +633,7 @@ class OC_Helper {
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function issubdirectory($sub, $parent) {
|
public static function issubdirectory($sub, $parent) {
|
||||||
if (strpos(realpath($sub), realpath($parent)) !== false) {
|
if (strpos(realpath($sub), realpath($parent)) === 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue