1
0
Mirror von https://github.com/nextcloud/server.git synchronisiert 2024-07-25 22:04:58 +02:00

fix search results having files from other users

Dieser Commit ist enthalten in:
Robin Appelman 2011-07-31 15:35:37 +02:00
Ursprung 5ef407d1c9
Commit b93b066a42

Datei anzeigen

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