Skip to content
Snippets Groups Projects
Commit 99adfbdb authored by Lukas Reschke's avatar Lukas Reschke
Browse files

Check for string position instead of string existence

otherwise /foo/bar would be detected as a subfolder of /bar

THX @icewind1991
parent b7db967d
Branches
No related tags found
No related merge requests found
......@@ -633,7 +633,7 @@ class OC_Helper {
* @return bool
*/
public static function issubdirectory($sub, $parent) {
if (strpos(realpath($sub), realpath($parent)) !== false) {
if (strpos(realpath($sub), realpath($parent)) === 0) {
return true;
}
return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment