diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:12:12 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:12:12 -0400 |
commit | c9aa36da061816dee256a979c2ff8d2ee41824d9 (patch) | |
tree | 29f7002b80ee984b488bd047dbbd80b36bf892e9 /maintenance/deleteBatch.php | |
parent | b4274e0e33eafb5e9ead9d949ebf031a9fb8363b (diff) | |
parent | d1ba966140d7a60cd5ae4e8667ceb27c1a138592 (diff) |
Merge branch 'archwiki'
# Conflicts:
# skins/ArchLinux.php
# skins/ArchLinux/archlogo.gif
Diffstat (limited to 'maintenance/deleteBatch.php')
-rw-r--r-- | maintenance/deleteBatch.php | 14 |
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... " ); } |