From eaf83a25779ce8692ef40e8116e9d321fdd76d4f Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Wed, 7 Jan 2009 13:07:21 +0000 Subject: [PATCH] Special:Upload can now have a custom upload message instead of uploadtext by passing "uploadmsg" parameter in the url. Message name is MediaWiki:Uploadtext-custom if the page is called with Special:Upload?uploadmsg=custom. The default message will be used if the custom messages doesn't exist. This should fix the Commons "uselang" hack on for Special:Upload. --- RELEASE-NOTES | 2 ++ includes/specials/SpecialUpload.php | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c938415953..72f15c0311 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -259,6 +259,8 @@ The following extensions are migrated into MediaWiki 1.14: * Make "Did you mean" search feature more noticeable * (bug 16720) Transcluded Special:NewPages processes "/username=" * Added "Advanced search" link to the search form +* Special:Upload can now have a custom upload message instead of uploadtext by + passing "uploadmsg" parameter in the url === Bug fixes in 1.14 === diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index 450c8728a1..971de04078 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -996,8 +996,19 @@ wgUploadAutoFill = {$autofill}; $wgOut->addHTML( "

{$sub}

\n" . "{$msg}\n" ); } + + $uploadMsg = $wgRequest->getVal( 'uploadmsg' ); + if( $uploadMsg ) { + $uploadMsgName = 'uploadtext-' . $uploadMsg; + // Fall back to normal message if the custom messages is empty + if( wfEmptyMsg( $uploadMsgName, wfMsg( $uploadMsgName ) ) ) + $uploadMsgName = 'uploadtext'; + } else { + $uploadMsgName = 'uploadtext'; + } + $wgOut->addHTML( '
' ); - $wgOut->addWikiMsg( 'uploadtext', $this->mDesiredDestName ); + $wgOut->addWikiMsg( $uploadMsgName, $this->mDesiredDestName ); $wgOut->addHTML( "
\n" ); # Print a list of allowed file extensions, if so configured. We ignore -- 2.20.1