From: aude Date: Sun, 27 Oct 2013 21:15:19 +0000 (+0000) Subject: set url used in createaccount-text to main page canonical url X-Git-Tag: 1.31.0-rc.0~18113^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%29%20.%20%22?a=commitdiff_plain;h=cc11be34c7cc7d199c7d7838324bbea709b1439f;p=lhc%2Fweb%2Fwiklou.git set url used in createaccount-text to main page canonical url $wgScript (index.php) appended to the site url (e.g. https://en.wikipedia.org/w/index.php) seems pointless in the context of these email messages. Change-Id: I1ae1ef164aa2db66e9370640e1e7dbddbed811c2 --- diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index 5ac3e6546e..db77399e28 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -865,7 +865,7 @@ class LoginForm extends SpecialPage { * @return Status object */ function mailPasswordInternal( $u, $throttle = true, $emailTitle = 'passwordremindertitle', $emailText = 'passwordremindertext' ) { - global $wgCanonicalServer, $wgScript, $wgNewPasswordExpiry; + global $wgNewPasswordExpiry; if ( $u->getEmail() == '' ) { return Status::newFatal( 'noemail', $u->getName() ); @@ -882,7 +882,11 @@ class LoginForm extends SpecialPage { $u->setNewpassword( $np, $throttle ); $u->saveSettings(); $userLanguage = $u->getOption( 'language' ); - $m = $this->msg( $emailText, $ip, $u->getName(), $np, '<' . $wgCanonicalServer . $wgScript . '>', + + $mainPage = Title::newMainPage(); + $mainPageUrl = $mainPage->getCanonicalURL(); + + $m = $this->msg( $emailText, $ip, $u->getName(), $np, '<' . $mainPageUrl . '>', round( $wgNewPasswordExpiry / 86400 ) )->inLanguage( $userLanguage )->text(); $result = $u->sendMail( $this->msg( $emailTitle )->inLanguage( $userLanguage )->text(), $m );