return fixed path, skip shared files outside of 'files'

This commit is contained in:
Jörn Friedrich Dreyer 2013-08-07 18:18:40 +02:00 committed by Victor Dubiniuk
parent 27511d9187
commit 392c6b6832
1 changed files with 6 additions and 3 deletions

View File

@ -254,9 +254,12 @@ class Shared_Cache extends Cache {
$result = \OC_DB::executeAudited($sql, array_merge(array($pattern), $chunk));
while ($row = $result->fetchRow()) {
$row['mimetype'] = $this->getMimetype($row['mimetype']);
$row['mimepart'] = $this->getMimetype($row['mimepart']);
$files[] = $row;
if (substr($row['path'], 0, 6)==='files/') {
$row['path'] = substr($row['path'],6); // remove 'files/' from path as it's relative to '/Shared'
$row['mimetype'] = $this->getMimetype($row['mimetype']);
$row['mimepart'] = $this->getMimetype($row['mimepart']);
$files[] = $row;
} // else skip results out of the files folder
}
}
return $files;