Added file old version name sanity check to recordUpload2()
authorAaron Schulz <aaron@users.mediawiki.org>
Sun, 4 Dec 2011 23:34:24 +0000 (23:34 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sun, 4 Dec 2011 23:34:24 +0000 (23:34 +0000)
includes/filerepo/file/LocalFile.php

index df71443..74eb0c7 100644 (file)
@@ -1007,6 +1007,9 @@ class LocalFile extends File {
                );
 
                if ( $dbw->affectedRows() == 0 ) {
+                       if ( $oldver == '' ) {
+                               throw new MWException( "Empty oi_archive_name. Database and storage out of sync?" );
+                       }
                        $reupload = true;
 
                        # Collision, this is an update of a file