summaryrefslogtreecommitdiff
path: root/maintenance/deleteBatch.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2014-12-27 15:41:37 +0100
committerPierre Schmitz <pierre@archlinux.de>2014-12-31 11:43:28 +0100
commitc1f9b1f7b1b77776192048005dcc66dcf3df2bfb (patch)
tree2b38796e738dd74cb42ecd9bfd151803108386bc /maintenance/deleteBatch.php
parentb88ab0086858470dd1f644e64cb4e4f62bb2be9b (diff)
Update to MediaWiki 1.24.1
Diffstat (limited to 'maintenance/deleteBatch.php')
-rw-r--r--maintenance/deleteBatch.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/maintenance/deleteBatch.php b/maintenance/deleteBatch.php
index c1cc03cd..93507b34 100644
--- a/maintenance/deleteBatch.php
+++ b/maintenance/deleteBatch.php
@@ -3,11 +3,11 @@
* Deletes a batch of pages.
* Usage: php deleteBatch.php [-u <user>] [-r <reason>] [-i <interval>] [listfile]
* where
- * [listfile] is a file where each line contains the title of a page to be
- * deleted, standard input is used if listfile is not given.
- * <user> is the username
- * <reason> is the delete reason
- * <interval> is the number of seconds to sleep for after each delete
+ * [listfile] is a file where each line contains the title of a page to be
+ * deleted, standard input is used if listfile is not given.
+ * <user> is the username
+ * <reason> is the delete reason
+ * <interval> is the number of seconds to sleep for after each delete
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -79,7 +79,9 @@ class DeleteBatch extends Maintenance {
$dbw = wfGetDB( DB_MASTER );
# Handle each entry
+ // @codingStandardsIgnoreStart Ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
for ( $linenum = 1; !feof( $file ); $linenum++ ) {
+ // @codingStandardsIgnoreEnd
$line = trim( fgets( $file ) );
if ( $line == '' ) {
continue;
@@ -97,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... " );
}