Index: trunk/phase3/includes/Import.php |
— | — | @@ -1153,6 +1153,10 @@ |
1154 | 1154 | } |
1155 | 1155 | $sha1 = $this->getSha1(); |
1156 | 1156 | 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 | + } |
1157 | 1161 | wfDebug( __METHOD__ . ": Corrupt file $source.\n" ); |
1158 | 1162 | return false; |
1159 | 1163 | } |