Pass the parameters to the error message in UploadStash::stashFile().
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Fri, 10 Aug 2012 19:14:01 +0000 (21:14 +0200)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Fri, 10 Aug 2012 19:17:18 +0000 (21:17 +0200)
Currently it shows the error message without any parameters since
$error is an array with the message name and its parameters, and
the Message class thinks that this is a message with its fallbacks
(see wfMessageFallback())

Change-Id: I5d825144795ad108f0a71f90cc530629c5c98a41

includes/upload/UploadStash.php

index bbee0f5..aa65ffe 100644 (file)
@@ -239,7 +239,8 @@ class UploadStash {
                                }
                        }
                        // at this point, $error should contain the single "most important" error, plus any parameters.
-                       throw new UploadStashFileException( "Error storing file in '$path': " . wfMessage( $error )->text() );
+                       $errorMsg = array_shift( $error );
+                       throw new UploadStashFileException( "Error storing file in '$path': " . wfMessage( $errorMsg, $error )->text() );
                }
                $stashPath = $storeStatus->value;