(bug 19833) Make the searching-for-an-IP-means-you-want-Special:Contributions behavior configurable. Patch by Olivier Finlay Beaton

This commit is contained in:
Roan Kattouw 2011-11-14 20:00:35 +00:00
parent 2ff455acb7
commit a123a76c8a
4 changed files with 17 additions and 4 deletions

View file

@ -145,6 +145,7 @@ following names for their contribution to the product.
* Nx.devnull
* Nikolaos S. Karastathis
* Olaf Lenz
* Olivier Finlay Beaton
* Paul Copperman
* Paul Oranje
* PieRRoMaN

View file

@ -81,6 +81,8 @@ production.
* (bug 30062) Add $wgDBprefix option to cli installer
* getUserPermissionsErrors and getUserPermissionsErrorsExpensive hooks are now
also called when checking for 'read' permission
* Introduce $wgEnableSearchContributorsByIP which controls whether searching
for an IP address redirects to the contributions list for that IP
=== Bug fixes in 1.19 ===
* $wgUploadNavigationUrl should be used for file redlinks if

View file

@ -4330,6 +4330,13 @@ $wgSitemapNamespaces = false;
*/
$wgSitemapNamespacesPriorities = false;
/**
* Search IP
* Treat IP searches as a contributor search for those
* with permissions to do so.
*/
$wgEnableSearchContributorsByIP = true;
/** @} */ # end of search settings
/************************************************************************//**

View file

@ -148,7 +148,7 @@ class SearchEngine {
* Really find the title match.
*/
private static function getNearMatchInternal( $searchterm ) {
global $wgContLang;
global $wgContLang, $wgEnableSearchContributorsByIP;
$allSearchTerms = array( $searchterm );
@ -215,10 +215,13 @@ class SearchEngine {
$title = Title::newFromText( $searchterm );
# 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() );
if ( $wgEnableSearchContributorsByIP ) {
if ( ( $title->getNamespace() == NS_USER && User::isIP( $title->getText() ) )
|| User::isIP( trim( $searchterm ) ) ) {
return SpecialPage::getTitleFor( 'Contributions', $title->getDBkey() );
}
}