Fix a few undeclared variables in upload warning code.
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Sat, 30 Aug 2008 22:07:59 +0000 (22:07 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Sat, 30 Aug 2008 22:07:59 +0000 (22:07 +0000)
includes/UploadFromBase.php
includes/specials/SpecialUpload.php

index 81a60ce..1a8fae8 100644 (file)
@@ -214,7 +214,7 @@ class UploadFromBase {
                # If the file existed before and was deleted, warn the user of this
                # Don't bother doing so if the file exists now, however
                if( $this->mLocalFile->wasDeleted() && !$this->mLocalFile->exists() )
-                       $warning['filewasdeleted'] = true;
+                       $warning['filewasdeleted'] = $this->mLocalFile->getTitle();
                        
                return $warning;
        }
@@ -737,7 +737,7 @@ class UploadFromBase {
                        return array( 'exists', $file );
                
                if( $file->getTitle()->getArticleID() )
-                       return array( 'page-exists', false );
+                       return array( 'page-exists', $file );
                
                if( strpos( $file->getName(), '.' ) == false ) {
                        $partname = $file->getName();
index d2a55f0..24f68c5 100644 (file)
@@ -509,7 +509,7 @@ class UploadForm {
         * @access private
         */
        function uploadWarning( $warnings ) {
-               global $wgOut;
+               global $wgOut, $wgUser;
                global $wgUseCopyrightUpload;
 
                $this->mSessionKey = $this->mUpload->stashSession();
@@ -517,6 +517,8 @@ class UploadForm {
                        # Couldn't save file; an error has been displayed so let's go.
                        return;
                }
+               
+               $sk = $wgUser->getSkin();
 
                $wgOut->addHTML( '<h2>' . wfMsgHtml( 'uploadwarning' ) . "</h2>\n" );
                $wgOut->addHTML( '<ul class="warning">' );
@@ -530,7 +532,7 @@ class UploadForm {
                                } elseif( $warning == 'filewasdeleted' ) {
                                        $ltitle = SpecialPage::getTitleFor( 'Log' );
                                        $llink = $sk->makeKnownLinkObj( $ltitle, wfMsgHtml( 'deletionlog' ),
-                                               'type=delete&page=' . $file->getTitle()->getPrefixedUrl() );
+                                               'type=delete&page=' . $args->getPrefixedUrl() );
                                        $msg = "\t<li>" . wfMsgWikiHtml( 'filewasdeleted', $llink ) . "</li>\n";
                                } else {
                                        if( is_bool( $args ) )