From 4fb56fec5afab07b1700e840c28c04852d2ec5c1 Mon Sep 17 00:00:00 2001 From: withoutaname Date: Fri, 9 May 2014 00:34:19 -0700 Subject: [PATCH] Prevent deleteBatch.php deleting files from redirects 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 | 3 +++ maintenance/deleteBatch.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES-1.24 b/RELEASE-NOTES-1.24 index fb23b71356..8686441719 100644 --- a/RELEASE-NOTES-1.24 +++ b/RELEASE-NOTES-1.24 @@ -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 diff --git a/maintenance/deleteBatch.php b/maintenance/deleteBatch.php index a751396734..93507b3467 100644 --- a/maintenance/deleteBatch.php +++ b/maintenance/deleteBatch.php @@ -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... " ); } -- 2.20.1