r90294 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90293‎ | r90294 | r90295 >
Date:16:48, 17 June 2011
Author:btongminh
Status:ok
Tags:
Comment:
Per comments on r88145: unlink file if it is broken
Modified paths:
  • /trunk/phase3/includes/Import.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Import.php
@@ -1153,6 +1153,10 @@
11541154 }
11551155 $sha1 = $this->getSha1();
11561156 if ( $sha1 && ( $sha1 !== sha1_file( $source ) ) ) {
 1157+ if ( $flags & File::DELETE_SOURCE ) {
 1158+ # Broken file; delete it if it is a temporary file
 1159+ unlink( $source );
 1160+ }
11571161 wfDebug( __METHOD__ . ": Corrupt file $source.\n" );
11581162 return false;
11591163 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r88145Follow-up r87176: Make importDump.php import files...btongminh10:39, 15 May 2011

Status & tagging log