(bug 42036) Account creation email link needs protocol
authorBrad Jorsch <bjorsch@wikimedia.org>
Mon, 12 Nov 2012 04:53:22 +0000 (20:53 -0800)
committerBrad Jorsch <bjorsch@wikimedia.org>
Mon, 12 Nov 2012 04:59:28 +0000 (20:59 -0800)
In other words, use $wgCanonicalServer instead of $wgServer.

Change-Id: I110db4d27ce935d732e16830951af0f349e99e99

RELEASE-NOTES-1.21
includes/specials/SpecialUserlogin.php

index b9b026c..923df75 100644 (file)
@@ -61,6 +61,8 @@ production.
 * (bug 41793) Contribution links to users with 0 edits on Special:ListUsers didn't
   show up red.
 * (bug 41899) A PHP notice no longer occurs when using the "rvcontinue" API parameter.
+* (bug 42036) Account creation emails now contain canonical (not
+  protocol-relative) URLs.
 
 === API changes in 1.21 ===
 * prop=revisions can now report the contentmodel and contentformat, see docs/contenthandler.txt
index f80e7da..c077c4d 100644 (file)
@@ -855,7 +855,7 @@ class LoginForm extends SpecialPage {
         * @return Status object
         */
        function mailPasswordInternal( $u, $throttle = true, $emailTitle = 'passwordremindertitle', $emailText = 'passwordremindertext' ) {
-               global $wgServer, $wgScript, $wgNewPasswordExpiry;
+               global $wgCanonicalServer, $wgScript, $wgNewPasswordExpiry;
 
                if ( $u->getEmail() == '' ) {
                        return Status::newFatal( 'noemail', $u->getName() );
@@ -872,7 +872,7 @@ class LoginForm extends SpecialPage {
                $u->setNewpassword( $np, $throttle );
                $u->saveSettings();
                $userLanguage = $u->getOption( 'language' );
-               $m = $this->msg( $emailText, $ip, $u->getName(), $np, '<' . $wgServer . $wgScript . '>',
+               $m = $this->msg( $emailText, $ip, $u->getName(), $np, '<' . $wgCanonicalServer . $wgScript . '>',
                        round( $wgNewPasswordExpiry / 86400 ) )->inLanguage( $userLanguage )->text();
                $result = $u->sendMail( $this->msg( $emailTitle )->inLanguage( $userLanguage )->text(), $m );