summaryrefslogtreecommitdiff
path: root/includes/SearchEngine.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2009-06-10 13:00:47 +0200
committerPierre Schmitz <pierre@archlinux.de>2009-06-10 13:00:47 +0200
commit72e90545454c0e014318fa3c81658e035aac58c1 (patch)
tree9212e3f46868989c4d57ae9a5c8a1a80e4dc0702 /includes/SearchEngine.php
parent565a0ccc371ec1a2a0e9b39487cbac18e6f60e25 (diff)
applying patch to version 1.15.0
Diffstat (limited to 'includes/SearchEngine.php')
-rw-r--r--includes/SearchEngine.php15
1 files changed, 10 insertions, 5 deletions
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];