r23802 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23801‎ | r23802 | r23803 >
Date:21:50, 6 July 2007
Author:tstarling
Status:old
Tags:
Comment:
Don't move the destination to the archive until we have checked that the source file exists. This was causing some data "misplacement" on double-submission of the upload warning confirmation form.
Modified paths:
  • /trunk/phase3/includes/filerepo/FSRepo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/FSRepo.php
@@ -214,6 +214,11 @@
215215 $dstDir = dirname( $dstPath );
216216 if ( !is_dir( $dstDir ) ) wfMkdirParents( $dstDir );
217217
 218+ // Check if the source is missing before we attempt to move the dest to archive
 219+ if ( !is_file( $srcPath ) ) {
 220+ return new WikiErrorMsg( 'filenotfound', wfEscapeWikiText( $srcPath ) );
 221+ }
 222+
218223 if( is_file( $dstPath ) ) {
219224 $archiveDir = dirname( $archivePath );
220225 if ( !is_dir( $archiveDir ) ) wfMkdirParents( $archiveDir );

Follow-up revisions

RevisionCommit summaryAuthorDate
r23912Merged revisions 23662-23909 via svnmerge from...david18:11, 9 July 2007

Status & tagging log