]> source.dussan.org Git - nextcloud-server.git/commitdiff
Check for string position instead of string existence
authorLukas Reschke <lukas@statuscode.ch>
Mon, 14 Jan 2013 15:51:31 +0000 (16:51 +0100)
committerLukas Reschke <lukas@statuscode.ch>
Mon, 14 Jan 2013 15:51:35 +0000 (16:51 +0100)
otherwise /foo/bar would be detected as a subfolder of /bar

THX @icewind1991

lib/helper.php

index 47292c56ea8e08e15a345e6882463ca285aa83b0..e7c9ac8015d1fa70883f52087a2f6142da2778d4 100644 (file)
@@ -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;