diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-07-31 15:35:37 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-07-31 15:35:37 +0200 |
commit | b93b066a425fae11d304ee59f8d745e1251005a9 (patch) | |
tree | 4138192ba2cf201d56f608562cecb9146c0b240e /lib/filesystem.php | |
parent | 5ef407d1c97cecf932e2578da71362c0353b96c9 (diff) | |
download | nextcloud-server-b93b066a425fae11d304ee59f8d745e1251005a9.tar.gz nextcloud-server-b93b066a425fae11d304ee59f8d745e1251005a9.zip |
fix search results having files from other users
Diffstat (limited to 'lib/filesystem.php')
-rw-r--r-- | lib/filesystem.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/filesystem.php b/lib/filesystem.php index 6022aa585ba..a688c9c2b06 100644 --- a/lib/filesystem.php +++ b/lib/filesystem.php @@ -573,14 +573,17 @@ class OC_Filesystem{ static public function search($query){ $files=array(); - $fakeRootLength=strlen(self::$fakeRoot); + $fakeRoot=self::$fakeRoot; + $fakeRootLength=strlen($fakeRoot); foreach(self::$storages as $mountpoint=>$storage){ $results=$storage->search($query); if(is_array($results)){ foreach($results as $result){ $file=str_replace('//','/',$mountpoint.$result); - $file=substr($file,$fakeRootLength); - $files[]=$file; + if(substr($file,0,$fakeRootLength)==$fakeRoot){ + $file=substr($file,$fakeRootLength); + $files[]=$file; + } } } } |