$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;