http://www.mediawiki.org/wiki/Special:Code/MediaWiki/95671

Revision: 95671
Author:   neilk
Date:     2011-08-29 15:46:45 +0000 (Mon, 29 Aug 2011)
Log Message:
-----------
MFT of r94966. Slight change in brace style because ariel already committed a 
very similar fix

Modified Paths:
--------------
    branches/wmf/1.17wmf1/includes/upload/UploadFromStash.php

Modified: branches/wmf/1.17wmf1/includes/upload/UploadFromStash.php
===================================================================
--- branches/wmf/1.17wmf1/includes/upload/UploadFromStash.php   2011-08-29 
15:45:54 UTC (rev 95670)
+++ branches/wmf/1.17wmf1/includes/upload/UploadFromStash.php   2011-08-29 
15:46:45 UTC (rev 95671)
@@ -29,12 +29,11 @@
                if( $stash ) {
                        $this->stash = $stash;
                } else {
-                       if ($user) {
+                       if( $user ) {
                                wfDebug( __METHOD__ . " creating new 
UploadStash instance for " . $user->getId() . "\n" );
+                       } else {
+                               wfDebug( __METHOD__ . " creating new 
UploadStash instance with no user\n" );
                        }
-                       else {
-                               wfDebug( __METHOD__ . " creating new 
UploadStash instance, no user\n");
-                       }
                        $this->stash = new UploadStash( $this->repo, 
$this->user );
                }
 
@@ -92,13 +91,13 @@
 
 
        /**
-        * There is no need to stash the image twice
+        * Stash the file.
         */
        public function stashFile() {
-               if ( $this->mLocalFile ) {
-                       return $this->mLocalFile;
-               }
-               return parent::stashFile();
+               // replace mLocalFile with an instance of UploadStashFile, 
which adds some methods
+               // that are useful for stashed files.
+               $this->mLocalFile = parent::stashFile();
+               return $this->mLocalFile;
        }
 
        /**


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to