From 24fed37a415aca1b4916d1fb99ef502fcd2cbd9e Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Mon, 6 Oct 2008 02:31:25 +0000 Subject: [PATCH] Disable double redirect fixer by default, pending resolution of bug 15622, causes more harm than good. --- includes/DefaultSettings.php | 6 ++++++ includes/specials/SpecialMovepage.php | 21 +++++++++++++-------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index e1c5188d16..2fda0a59f2 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -3431,6 +3431,12 @@ $wgExpensiveParserFunctionLimit = 100; */ $wgMaximumMovedPages = 100; +/** + * Fix double redirects after a page move. + * Tends to conflict with page move vandalism, use only on a private wiki. + */ +$wgFixDoubleRedirects = false; + /** * Array of namespaces to generate a sitemap for when the * maintenance/generateSitemap.php script is run, or false if one is to be ge- diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index dffa2e4375..f86d9544bb 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -81,7 +81,7 @@ class MovePageForm { } function showForm( $err ) { - global $wgOut, $wgUser; + global $wgOut, $wgUser, $wgFixDoubleRedirects; $skin = $wgUser->getSkin(); @@ -136,12 +136,16 @@ class MovePageForm { $considerTalk = ( !$this->oldTitle->isTalkPage() && $oldTalk->exists() ); $dbr = wfGetDB( DB_SLAVE ); - $hasRedirects = $dbr->selectField( 'redirect', '1', - array( - 'rd_namespace' => $this->oldTitle->getNamespace(), - 'rd_title' => $this->oldTitle->getDBkey(), - ) , __METHOD__ ); - + if ( $wgFixDoubleRedirects ) { + $hasRedirects = $dbr->selectField( 'redirect', '1', + array( + 'rd_namespace' => $this->oldTitle->getNamespace(), + 'rd_title' => $this->oldTitle->getDBkey(), + ) , __METHOD__ ); + } else { + $hasRedirects = false; + } + if ( $considerTalk ) { $wgOut->addWikiMsg( 'movepagetalktext' ); } @@ -277,6 +281,7 @@ class MovePageForm { function doSubmit() { global $wgOut, $wgUser, $wgRequest, $wgMaximumMovedPages, $wgLang; + global $wgFixDoubleRedirects; if ( $wgUser->pingLimiter( 'move' ) ) { $wgOut->rateLimited(); @@ -320,7 +325,7 @@ class MovePageForm { return; } - if ( $this->fixRedirects ) { + if ( $wgFixDoubleRedirects && $this->fixRedirects ) { DoubleRedirectJob::fixRedirects( 'move', $ot, $nt ); } -- 2.20.1