mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
Search: fix Notice and thus broken search with activiated error reporting
This commit is contained in:
parent
33e9399ba3
commit
68fa2b10da
1 changed files with 5 additions and 1 deletions
|
|
@ -10,6 +10,7 @@ class OC_Search_Provider_File extends OC_Search_Provider{
|
|||
|
||||
$name = basename($path);
|
||||
$text = '';
|
||||
$skip = false;
|
||||
if($mime=='httpd/unix-directory') {
|
||||
$link = OC_Helper::linkTo( 'files', 'index.php', array('dir' => $path));
|
||||
$type = 'Files';
|
||||
|
|
@ -18,6 +19,7 @@ class OC_Search_Provider_File extends OC_Search_Provider{
|
|||
$mimeBase = $fileData['mimepart'];
|
||||
switch($mimeBase) {
|
||||
case 'audio':
|
||||
$skip = true;
|
||||
break;
|
||||
case 'text':
|
||||
$type = 'Text';
|
||||
|
|
@ -33,7 +35,9 @@ class OC_Search_Provider_File extends OC_Search_Provider{
|
|||
}
|
||||
}
|
||||
}
|
||||
$results[] = new OC_Search_Result($name, $text, $link, $type);
|
||||
if(!$skip) {
|
||||
$results[] = new OC_Search_Result($name, $text, $link, $type);
|
||||
}
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue