summaryrefslogtreecommitdiffstats
path: root/lib/helper.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2013-01-14 16:51:31 +0100
committerLukas Reschke <lukas@statuscode.ch>2013-01-14 16:51:35 +0100
commit99adfbdb8663d89b650feab6b797f344a46c82f3 (patch)
tree47154a31403b138120a3b6fd31a0f8acfeff80f2 /lib/helper.php
parentb7db967dc5c80b7b62c0a734d174acdc0fa49f6d (diff)
downloadnextcloud-server-99adfbdb8663d89b650feab6b797f344a46c82f3.tar.gz
nextcloud-server-99adfbdb8663d89b650feab6b797f344a46c82f3.zip
Check for string position instead of string existence
otherwise /foo/bar would be detected as a subfolder of /bar THX @icewind1991
Diffstat (limited to 'lib/helper.php')
-rw-r--r--lib/helper.php2
1 files changed, 1 insertions, 1 deletions
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;