From: withoutaname Date: Fri, 9 May 2014 07:34:19 +0000 (-0700) Subject: Prevent deleteBatch.php deleting files from redirects X-Git-Tag: 1.31.0-rc.0~15607^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22messagerie%22%29%20.%20%22?a=commitdiff_plain;h=4fb56fec5afab07b1700e840c28c04852d2ec5c1;p=lhc%2Fweb%2Fwiklou.git 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 --- 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... " ); }