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

Revision: 90531
Author:   platonides
Date:     2011-06-21 15:13:03 +0000 (Tue, 21 Jun 2011)
Log Message:
-----------
Follow up with the problem noted in r90530.
You can't pass the result of a function to reset(), since it expects a 
reference.

Those random errors show now as UploadStashFileException: error storing file in 
'tests/phpunit/includes/upload/bug29408.': fileexistserror 
images/temp/0/02/20110621151405!bug29408.
because it gets run twice in the same second.

Modified Paths:
--------------
    trunk/phase3/includes/upload/UploadStash.php

Modified: trunk/phase3/includes/upload/UploadStash.php
===================================================================
--- trunk/phase3/includes/upload/UploadStash.php        2011-06-21 15:06:59 UTC 
(rev 90530)
+++ trunk/phase3/includes/upload/UploadStash.php        2011-06-21 15:13:03 UTC 
(rev 90531)
@@ -140,9 +140,11 @@
                        // This is a bit lame, as we may have more info in the 
$status and we're throwing it away, but to fix it means
                        // redesigning API errors significantly.
                        // $status->value just contains the virtual URL (if 
anything) which is probably useless to the caller
-                       $error = reset( $status->getErrorsArray() );
+                       $error = $status->getErrorsArray();
+                       $error = reset( $error );
                        if ( ! count( $error ) ) {
-                               $error = reset( $status->getWarningsArray() );
+                               $error = $status->getWarningsArray();
+                               $error = reset( $error );
                                if ( ! count( $error ) ) {
                                        $error = array( 'unknown', 'no error 
recorded' );
                                }


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to