From 6c362522dfefd40753d41f12d600cd967f474d13 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 21 Aug 2009 22:42:09 +0000 Subject: [PATCH] Revert r53600 "Add $wgSecondaryGoNamespace, used if an exact match is not found when pressing go - will try to find a match in a different namespace before performing a search." Revert r53618 "* Replace $wgSecondaryGoNamespace with $wgSecondaryGoNamespaces (taking an array of integers instead of just an integer), per code review of r53600." Revert r53672 "* Add release note for r53618." Per bug 11380 this should probably be using the default search namespaces or the user's search namespaces; an additional config array seems unnecessary. --- RELEASE-NOTES | 4 ---- includes/DefaultSettings.php | 8 -------- includes/search/SearchEngine.php | 10 +--------- 3 files changed, 1 insertion(+), 21 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index f70a36f4e4..e309120675 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -73,8 +73,6 @@ this. Was used when mwEmbed was going to be an extension. to same server * $wgSpecialVersionExtended shows the extended version information besides PHP and database version. -* $wgSecondaryGoNamespaces allows an arry of namespaces to be checked when the - GO button is pressed, in addition to the main namespace. * (bug 19907) $wgCrossSiteAJAXdomains and $wgCrossSiteAJAXdomainExceptions added to control which external domains may access the API via cross-site AJAX. * $wgMaintenanceScripts for extensions to add their scripts to the default list @@ -156,8 +154,6 @@ this. Was used when mwEmbed was going to be an extension. * (bug 14201) Set $wgDBadminuser/$wgDBadminpassword during setup * (bug 18768) Remove AdminSettings requirements. Maintenance environment will still load it if it exists, but it's not required for anything -* Added $wgSecondaryGoNamespaces, allowing an array of namespaces to be checked - when the Go button is pressed in addition to the main namespace. * (bug 19900) The "listgrouprights-key" message is now wrapped in a div with class "mw-listgrouprights-key" * (bug 471) Allow RSS feeds for watchlist, using an opt-in security token diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index fe24633aa1..2b3e7cb4f0 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -4128,14 +4128,6 @@ $wgAutocreatePolicy = 'login'; */ $wgAllowPrefChange = array(); -/** - * If an exact match is not found, try to find a match in different namespaces - * before performing a search. - * - * Array: Ids of namespaces to attempt match in, in desired order. - */ -$wgSecondaryGoNamespaces = null; - /** * Settings for incoming cross-site AJAX requests: diff --git a/includes/search/SearchEngine.php b/includes/search/SearchEngine.php index aab14cbba1..daec7cad39 100644 --- a/includes/search/SearchEngine.php +++ b/includes/search/SearchEngine.php @@ -63,7 +63,7 @@ class SearchEngine { * @return Title */ public static function getNearMatch( $searchterm ) { - global $wgContLang, $wgSecondaryGoNamespaces; + global $wgContLang; $allSearchTerms = array($searchterm); @@ -88,14 +88,6 @@ class SearchEngine { return $title; } - # If a match is not found in the main namespace look in secondary go namespaces. - if( $wgSecondaryGoNamespaces && $title->getNamespace() == NS_MAIN ) { - foreach( $wgSecondaryGoNamespaces as $ns ) { - $title = Title::newFromText( $term, $ns ); - if( $title && $title->exists() ) return $title; - } - } - # Now try all lower case (i.e. first letter capitalized) # $title = Title::newFromText( $wgContLang->lc( $term ) ); -- 2.20.1