From c0e718d43f62e645f8b301256d461eeadb7472d4 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Sun, 2 Oct 2011 20:02:35 +0000 Subject: [PATCH] (bug 31293) If Special:Userlogin is loaded over HTTPS, display MediaWiki:loginend-https instead of MediaWiki:loginend, if it exists --- RELEASE-NOTES-1.18 | 2 ++ includes/specials/SpecialUserlogin.php | 8 ++++++++ includes/templates/Userlogin.php | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES-1.18 b/RELEASE-NOTES-1.18 index 0e1404fd53..39b711eb93 100644 --- a/RELEASE-NOTES-1.18 +++ b/RELEASE-NOTES-1.18 @@ -220,6 +220,8 @@ production. User:getDefaultOptions(). * (bug 30497) Add client-nojs and client-js classes on document element to let styles easily hide or show things based on general JS availability +* (bug 31293) If Special:Userlogin is loaded over HTTPS, display + MediaWiki:loginend-https instead of MediaWiki:loginend, if it exists === Bug fixes in 1.18 === * mw.util.getScript has been implemented (like wfScript in GlobalFunctions.php) diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index 8ef0d1dd34..c816979103 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -1039,6 +1039,14 @@ class LoginForm extends SpecialPage { if( $this->mLanguage ) $template->set( 'uselang', $this->mLanguage ); } + + // Use loginend-https for HTTPS requests if it exists, loginend otherwise + $httpsMsg = wfMessage( 'loginend-https' ); + if ( WebRequest::detectProtocol() == 'https' && $httpsMsg->exists() ) { + $template->set( 'loginend', $httpsMsg->parse() ); + } else { + $template->set( 'loginend', wfMessage( 'loginend' )->parse() ); + } // Give authentication and captcha plugins a chance to modify the form $wgAuth->modifyUITemplate( $template, $this->mType ); diff --git a/includes/templates/Userlogin.php b/includes/templates/Userlogin.php index 2b9ff3f7ba..1bb8fc38f9 100644 --- a/includes/templates/Userlogin.php +++ b/includes/templates/Userlogin.php @@ -152,7 +152,7 @@ class UserloginTemplate extends QuickTemplate { haveData( 'token' ) ) { ?> -
msgWiki( 'loginend' ); ?>
+
html( 'loginend' ); ?>