Search: fix Notice and thus broken search with activiated error reporting
This commit is contained in:
parent
33e9399ba3
commit
68fa2b10da
|
@ -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{
|
||||||
$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{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(!$skip) {
|
||||||
$results[] = new OC_Search_Result($name, $text, $link, $type);
|
$results[] = new OC_Search_Result($name, $text, $link, $type);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue