From 99adfbdb8663d89b650feab6b797f344a46c82f3 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Mon, 14 Jan 2013 16:51:31 +0100 Subject: [PATCH] Check for string position instead of string existence otherwise /foo/bar would be detected as a subfolder of /bar THX @icewind1991 --- lib/helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/helper.php b/lib/helper.php index 47292c56ea8..e7c9ac8015d 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -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;