Skip to content
Snippets Groups Projects
Commit 68fa2b10 authored by Arthur Schiwon's avatar Arthur Schiwon
Browse files

Search: fix Notice and thus broken search with activiated error reporting

parent 33e9399b
Branches
No related tags found
No related merge requests found
...@@ -10,6 +10,7 @@ class OC_Search_Provider_File extends OC_Search_Provider{ ...@@ -10,6 +10,7 @@ class OC_Search_Provider_File extends OC_Search_Provider{
$name = basename($path); $name = basename($path);
$text = ''; $text = '';
$skip = false;
if($mime=='httpd/unix-directory') { if($mime=='httpd/unix-directory') {
$link = OC_Helper::linkTo( 'files', 'index.php', array('dir' => $path)); $link = OC_Helper::linkTo( 'files', 'index.php', array('dir' => $path));
$type = 'Files'; $type = 'Files';
...@@ -18,6 +19,7 @@ class OC_Search_Provider_File extends OC_Search_Provider{ ...@@ -18,6 +19,7 @@ class OC_Search_Provider_File extends OC_Search_Provider{
$mimeBase = $fileData['mimepart']; $mimeBase = $fileData['mimepart'];
switch($mimeBase) { switch($mimeBase) {
case 'audio': case 'audio':
$skip = true;
break; break;
case 'text': case 'text':
$type = 'Text'; $type = 'Text';
...@@ -33,8 +35,10 @@ class OC_Search_Provider_File extends OC_Search_Provider{ ...@@ -33,8 +35,10 @@ class OC_Search_Provider_File extends OC_Search_Provider{
} }
} }
} }
if(!$skip) {
$results[] = new OC_Search_Result($name, $text, $link, $type); $results[] = new OC_Search_Result($name, $text, $link, $type);
} }
}
return $results; return $results;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment