(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:
parent
2ff455acb7
commit
a123a76c8a
4 changed files with 17 additions and 4 deletions
1
CREDITS
1
CREDITS
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
/************************************************************************//**
|
||||
|
|
|
|||
|
|
@ -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() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue