* Support passing message arguments to OutputPage::showErrorPage()
authorRob Church <robchurch@users.mediawiki.org>
Fri, 18 May 2007 20:46:42 +0000 (20:46 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Fri, 18 May 2007 20:46:42 +0000 (20:46 +0000)
* (bug 8818) Expose "wpDestFile" as parameter $1 to "uploaddisabledtext"

RELEASE-NOTES
includes/OutputPage.php
includes/SpecialUpload.php

index 26e7b03..16f05d4 100644 (file)
@@ -31,6 +31,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   more information
 * (bug 9628) Show warnings about slave lag on Special:Contributions,
   Special:Watchlist
+* (bug 8818) Expose "wpDestFile" as parameter $1 to "uploaddisabledtext"
   
 == Bugfixes since 1.10 ==
 
index 397d521..458907f 100644 (file)
@@ -796,13 +796,13 @@ class OutputPage {
        }
 
        /**
-        * Outputs a pretty page to explain why the request exploded.
+        * Output a standard error page
         *
-        * @param string $title Message key for page title.
-        * @param string $msg   Message key for page text.
-        * @return nothing
+        * @param string $title Message key for page title
+        * @param string $msg Message key for page text
+        * @param array $params Message parameters
         */
-       public function showErrorPage( $title, $msg ) {
+       public function showErrorPage( $title, $msg, $params = array() ) {
                global $wgTitle;
 
                $this->mDebugtext .= 'Original title: ' .
@@ -813,9 +813,12 @@ class OutputPage {
                $this->setArticleRelated( false );
                $this->enableClientCache( false );
                $this->mRedirect = '';
-
                $this->mBodytext = '';
-               $this->addWikiText( wfMsg( $msg ) );
+               
+               array_unshift( $params, $msg );
+               $message = call_user_func_array( 'wfMsg', $params );
+               $this->addWikiText( $message );
+               
                $this->returnToMain( false );
        }
 
index af7597f..8e3a2d7 100644 (file)
@@ -209,7 +209,7 @@ class UploadForm {
 
                # Check uploading enabled
                if( !$wgEnableUploads ) {
-                       $wgOut->showErrorPage( 'uploaddisabled', 'uploaddisabledtext' );
+                       $wgOut->showErrorPage( 'uploaddisabled', 'uploaddisabledtext', array( $this->mDestFile ) );
                        return;
                }