Prevent deleteBatch.php deleting files from redirects
authorwithoutaname <drevitchi@gmail.com>
Fri, 9 May 2014 07:34:19 +0000 (00:34 -0700)
committerwithoutaname <drevitchi@gmail.com>
Fri, 23 May 2014 18:31:14 +0000 (11:31 -0700)
Previous behavior had the maintenance script deleteBatch.php
delete both the redirect in the file namespace and the file
from the target page the redirect is pointing to. This is
no longer the case, but it will still delete the redirect
page if it is still on the listfile.

Bug: 52587
Change-Id: I83374ddb98131f9f8f766bb2b444ab3e7cda7735

RELEASE-NOTES-1.24
maintenance/deleteBatch.php

index fb23b71..8686441 100644 (file)
@@ -59,6 +59,9 @@ production.
 * Parser now dies early if called recursively, instead of producing subtle bugs.
 * (bug 14323) Redirect pages, when viewed with redirect=no, no longer hide the
   remaining page content.
+* (bug 52587) Maintenance script deleteBatch.php no longer follows redirects
+  in the file namespace and delete the file on the target page. It will still
+  however delete the redirect page.
 
 === Web API changes in 1.24 ===
 * action=parse API now supports prop=modules, which provides the list of
index a751396..93507b3 100644 (file)
@@ -99,7 +99,7 @@ class DeleteBatch extends Maintenance {
                        $this->output( $title->getPrefixedText() );
                        $dbw->begin( __METHOD__ );
                        if ( $title->getNamespace() == NS_FILE ) {
-                               $img = wfFindFile( $title );
+                               $img = wfFindFile( $title, array( 'ignoreRedirect' => true ) );
                                if ( $img && $img->isLocal() && !$img->delete( $reason ) ) {
                                        $this->output( " FAILED to delete associated file... " );
                                }