From 72e90545454c0e014318fa3c81658e035aac58c1 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 10 Jun 2009 13:00:47 +0200 Subject: applying patch to version 1.15.0 --- includes/SearchEngine.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'includes/SearchEngine.php') diff --git a/includes/SearchEngine.php b/includes/SearchEngine.php index 3ea0341d..e5392f7c 100644 --- a/includes/SearchEngine.php +++ b/includes/SearchEngine.php @@ -80,8 +80,13 @@ class SearchEngine { if (is_null($title)) return NULL; - if ( $title->getNamespace() == NS_SPECIAL || $title->isExternal() - || $title->exists() ) { + if ( $title->getNamespace() == NS_SPECIAL || $title->isExternal() || $title->exists() ) { + return $title; + } + + # See if it still otherwise has content is some sane sense + $article = MediaWiki::articleFromTitle( $title ); + if( $article->hasViewableContent() ) { return $title; } @@ -403,7 +408,7 @@ class SearchEngine { if($wgMWSuggestTemplate) return $wgMWSuggestTemplate; else - return $wgServer . $wgScriptPath . '/api.php?action=opensearch&search={searchTerms}&namespace={namespaces}'; + return $wgServer . $wgScriptPath . '/api.php?action=opensearch&search={searchTerms}&namespace={namespaces}&suggest'; } } @@ -1165,12 +1170,12 @@ class SearchHighlighter { continue; } --$contextlines; - $pre = $wgContLang->truncate( $m[1], -$contextchars, ' ... ' ); + $pre = $wgContLang->truncate( $m[1], -$contextchars ); if ( count( $m ) < 3 ) { $post = ''; } else { - $post = $wgContLang->truncate( $m[3], $contextchars, ' ... ' ); + $post = $wgContLang->truncate( $m[3], $contextchars ); } $found = $m[2]; -- cgit v1.2.2