*Check $image->exists() rather that getArticleID() to avoid extraneous warning (bug...
authorAaron Schulz <aaron@users.mediawiki.org>
Thu, 15 Mar 2007 15:39:51 +0000 (15:39 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Thu, 15 Mar 2007 15:39:51 +0000 (15:39 +0000)
includes/SpecialUpload.php

index 0715ea0..fc75b15 100644 (file)
@@ -410,7 +410,8 @@ class UploadForm {
                                $warning .= '<li>'.wfMsgHtml( 'emptyfile' ).'</li>';
                        }
 
-                       if( $nt->getArticleID() ) {
+                       $image = new Image( $nt );
+                       if( $image->exists() ) {
                                global $wgUser;
                                $sk = $wgUser->getSkin();
                                $dlink = $sk->makeKnownLinkObj( $nt );
@@ -418,7 +419,6 @@ class UploadForm {
                        } else {
                                # If the file existed before and was deleted, warn the user of this
                                # Don't bother doing so if the image exists now, however
-                               $image = new Image( $nt );
                                if( $image->wasDeleted() ) {
                                        $skin = $wgUser->getSkin();
                                        $ltitle = SpecialPage::getTitleFor( 'Log' );