r80693 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80692‎ | r80693 | r80694 >
Date:17:42, 21 January 2011
Author:demon
Status:ok
Tags:
Comment:
(bug 26848) deleteArchivedFiles.php deletes db records, but not files
Modified paths:
  • /trunk/phase3/maintenance/deleteArchivedFiles.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/deleteArchivedFiles.inc
@@ -45,9 +45,12 @@
4646 array( 'FOR UPDATE' )
4747 );
4848 if ( $path && file_exists( $path ) && !$inuse ) {
49 - unlink( $path ); // delete
50 - $count++;
51 - $dbw->query( "DELETE FROM $tbl_arch WHERE fa_id = $id" );
 49+ if( unlink( $path ) ) { // delete
 50+ $count++;
 51+ $dbw->query( "DELETE FROM $tbl_arch WHERE fa_id = $id" );
 52+ } else {
 53+ $output->handleOutput( "Unable to remove file $path, skipping\n" );
 54+ }
5255 } else {
5356 $output->handleOutput( "Notice - file '$key' not found in group '$group'\n" );
5457 if ( $force ) {

Status & tagging log