From 68fa2b10da0ebec893d2c1b9cd693987e5777bc6 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Mon, 1 Oct 2012 19:11:26 +0200 Subject: [PATCH] Search: fix Notice and thus broken search with activiated error reporting --- lib/search/provider/file.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/search/provider/file.php b/lib/search/provider/file.php index e21278f391..24832296c5 100644 --- a/lib/search/provider/file.php +++ b/lib/search/provider/file.php @@ -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; }