diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2008-03-21 11:49:34 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2008-03-21 11:49:34 +0100 |
commit | 086ae52d12011746a75f5588e877347bc0457352 (patch) | |
tree | e73263c7a29d0f94fafb874562610e16eb292ba8 /includes/SearchEngine.php | |
parent | 749e7fb2bae7bbda855de3c9e319435b9f698ff7 (diff) |
Update auf MediaWiki 1.12.0
Diffstat (limited to 'includes/SearchEngine.php')
-rw-r--r-- | includes/SearchEngine.php | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/includes/SearchEngine.php b/includes/SearchEngine.php index 11fc3deb..c22e58d7 100644 --- a/includes/SearchEngine.php +++ b/includes/SearchEngine.php @@ -51,7 +51,7 @@ class SearchEngine { if($wgContLang->hasVariants()){ $allSearchTerms = array_merge($allSearchTerms,$wgContLang->convertLinkToAllVariants($searchterm)); } - + foreach($allSearchTerms as $term){ # Exact match? No need to look further. @@ -102,6 +102,12 @@ class SearchEngine { return $title; } } + + // Give hooks a chance at better match variants + $title = null; + if( !wfRunHooks( 'SearchGetNearMatch', array( $term, &$title ) ) ) { + return $title; + } } $title = Title::newFromText( $searchterm ); @@ -109,7 +115,7 @@ class SearchEngine { # Entering an IP address goes to the contributions page if ( ( $title->getNamespace() == NS_USER && User::isIP($title->getText() ) ) || User::isIP( trim( $searchterm ) ) ) { - return SpecialPage::getTitleFor( 'Contributions', $title->getDbkey() ); + return SpecialPage::getTitleFor( 'Contributions', $title->getDBkey() ); } @@ -336,7 +342,16 @@ class SearchResultSet { /** * @addtogroup Search */ +class SearchResultTooMany { + ## Some search engines may bail out if too many matches are found +} + + +/** + * @addtogroup Search + */ class SearchResult { + function SearchResult( $row ) { $this->mTitle = Title::makeTitle( $row->page_namespace, $row->page_title ); } |