From: Rob Church Date: Fri, 18 May 2007 20:46:42 +0000 (+0000) Subject: * Support passing message arguments to OutputPage::showErrorPage() X-Git-Tag: 1.31.0-rc.0~52878 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=0c919598c6fad96eedfb08ded767e70a42751d62;p=lhc%2Fweb%2Fwiklou.git * Support passing message arguments to OutputPage::showErrorPage() * (bug 8818) Expose "wpDestFile" as parameter $1 to "uploaddisabledtext" --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 26e7b0310e..16f05d4361 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 397d5214f5..458907fbfd 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -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 ); } diff --git a/includes/SpecialUpload.php b/includes/SpecialUpload.php index af7597f645..8e3a2d7093 100644 --- a/includes/SpecialUpload.php +++ b/includes/SpecialUpload.php @@ -209,7 +209,7 @@ class UploadForm { # Check uploading enabled if( !$wgEnableUploads ) { - $wgOut->showErrorPage( 'uploaddisabled', 'uploaddisabledtext' ); + $wgOut->showErrorPage( 'uploaddisabled', 'uploaddisabledtext', array( $this->mDestFile ) ); return; }