r95894 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95893‎ | r95894 | r95895 >
Date:18:08, 31 August 2011
Author:catrope
Status:ok (Comments)
Tags:
Comment:
Followup r95002: unbreak getTokenUrl() by using a simpler hack that doesn't involve $wgArticlePath
Modified paths:
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -3302,7 +3302,7 @@
33033303
33043304 /**
33053305 * Internal function to format the e-mail validation/invalidation URLs.
3306 - * This uses $wgArticlePath directly as a quickie hack to use the
 3306+ * This uses a quickie hack to use the
33073307 * hardcoded English names of the Special: pages, for ASCII safety.
33083308 *
33093309 * @note Since these URLs get dropped directly into emails, using the
@@ -3315,14 +3315,9 @@
33163316 * @return String Formatted URL
33173317 */
33183318 protected function getTokenUrl( $page, $token ) {
3319 - global $wgCanonicalServer, $wgArticlePath;
3320 -
3321 - return $wgCanonicalServer .
3322 - str_replace(
3323 - '$1',
3324 - "Special:$page/$token",
3325 - $wgArticlePath
3326 - );
 3319+ // Hack to bypass localization of 'Special:'
 3320+ $title = Title::makeTitle( NS_MAIN, "Special:$page/$token" );
 3321+ return $title->getCanonicalUrl();
33273322 }
33283323
33293324 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r959011.17wmf1: MFT HTTPS / prot rel URL fixes: r95627, r95651, r95652, r95653, r95...catrope19:15, 31 August 2011
r959031.17wmf1: MFT r95894 for real this time, followup r95901catrope19:22, 31 August 2011
r964751.18: MFT r94737, r94990, r95000, r95001, r95002, r95006, r95007, r95010, r95...catrope19:37, 7 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r95002Use canonical URLs (introduced in r94995) for all URLs in e-mailscatrope14:46, 19 August 2011

Comments

#Comment by Brion VIBBER (talk | contribs)   18:40, 31 August 2011

Seems to do the job -- local testing confirms that it runs through GetCanonicalURL hook as expected which should take care of the path fixup in production.

The use of Title::makeTitle to make a semi-bogus title feels icky, but is no worse than what we had before ;) and of course we do similar on purpose in cleanupTitles and friends so it should remain stable.

Status & tagging log