r96297 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96296‎ | r96297 | r96298 >
Date:19:29, 5 September 2011
Author:catrope
Status:ok
Tags:
Comment:
Don't use $wgServer (potentially protocol-relative!) in the password reset e-mail. The documentation calls for $4 to be "the base URL of the wiki" and the code was using $wgServer . $wgScript which produces the URL to index.php , so I decided to use the URL to the Main Page instead. This avoids using globals and doesn't suffer from mixed URL structure issues on secure.wm.o
Modified paths:
  • /trunk/phase3/includes/specials/SpecialPasswordReset.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialPasswordReset.php
@@ -152,7 +152,7 @@
153153 }
154154 }
155155
156 - global $wgServer, $wgScript, $wgNewPasswordExpiry;
 156+ global $wgNewPasswordExpiry;
157157
158158 // All the users will have the same email address
159159 if ( $firstUser->getEmail() == '' ) {
@@ -190,7 +190,7 @@
191191 $username,
192192 $passwordBlock,
193193 count( $passwords ),
194 - $wgServer . $wgScript,
 194+ Title::newMainPage()->getCanonicalUrl(),
195195 round( $wgNewPasswordExpiry / 86400 )
196196 );
197197

Follow-up revisions

RevisionCommit summaryAuthorDate
r964851.18: MFT protocol-relative URL saga: r95014, r95016, r95017, r95627, r95651,...catrope20:14, 7 September 2011

Status & tagging log