Browse Source

fix search results having files from other users

tags/v3.0
Robin Appelman 13 years ago
parent
commit
b93b066a42
1 changed files with 6 additions and 3 deletions
  1. 6
    3
      lib/filesystem.php

+ 6
- 3
lib/filesystem.php View File

@@ -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;
}
}
}
}

Loading…
Cancel
Save