summaryrefslogtreecommitdiffstats
path: root/lib/filesystem.php
diff options
context:
space:
mode:
authorMichael Gapczynski <GapczynskiM@gmail.com>2011-07-31 12:53:34 -0400
committerMichael Gapczynski <GapczynskiM@gmail.com>2011-07-31 12:53:34 -0400
commit17058c946717e7487302e87c118223227ddb9987 (patch)
tree0503c8f0d8b1f15f789216d6da4510ebeba3e81f /lib/filesystem.php
parent0d3ebbfefdc65a90c78fa49c28eccbd1e0dfb563 (diff)
parentb93b066a425fae11d304ee59f8d745e1251005a9 (diff)
downloadnextcloud-server-17058c946717e7487302e87c118223227ddb9987.tar.gz
nextcloud-server-17058c946717e7487302e87c118223227ddb9987.zip
Merge branch 'master' into sharing
Diffstat (limited to 'lib/filesystem.php')
-rw-r--r--lib/filesystem.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/filesystem.php b/lib/filesystem.php
index c2153520650..829482c7fa5 100644
--- a/lib/filesystem.php
+++ b/lib/filesystem.php
@@ -574,14 +574,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;
+ }
}
}
}