Disable double redirect fixer by default, pending resolution of bug 15622, causes...
authorTim Starling <tstarling@users.mediawiki.org>
Mon, 6 Oct 2008 02:31:25 +0000 (02:31 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Mon, 6 Oct 2008 02:31:25 +0000 (02:31 +0000)
includes/DefaultSettings.php
includes/specials/SpecialMovepage.php

index e1c5188..2fda0a5 100644 (file)
@@ -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-
index dffa2e4..f86d954 100644 (file)
@@ -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 );
                }