r96180 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96179‎ | r96180 | r96181 >
Date:13:17, 3 September 2011
Author:dantman
Status:resolved
Tags:
Comment:
Use wfExpandUrl+PROTO_CANONICAL inside of getCanonicalURL instead of just prepending the url so this does not break on interwiki and action=render
Modified paths:
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Title.php
@@ -1045,8 +1045,8 @@
10461046 */
10471047 public function getCanonicalURL( $query = '', $variant = false ) {
10481048 global $wgCanonicalServer;
1049 - $url = $wgCanonicalServer . $this->getLocalURL( $query, $variant ) . $this->getFragmentForURL();
1050 - wfRunHooks( 'GetCanonicalURL', array( &$this, &$url, $query ) );
 1049+ $url = wfExpandUrl( $this->getLocalURL( $query, $variant ) . $this->getFragmentForURL(), PROTO_CANONICAL );
 1050+ wfRunHooks( '', array( &$this, &$url, $query ) );
10511051 return $url;
10521052 }
10531053

Follow-up revisions

RevisionCommit summaryAuthorDate
r96273Followup r96180, I can't believe I did't notice I accidentally killed the hoo...dantman08:31, 5 September 2011
r96274Followup r96180: remove unused global $wgCanonicalServercatrope10:55, 5 September 2011
r963601.17wmf1: MFT r96180, r96228, r96273, r96286catrope19:11, 6 September 2011
r964851.18: MFT protocol-relative URL saga: r95014, r95016, r95017, r95627, r95651,...catrope20:14, 7 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r94995Per CR on r44412 and my promise in the commit summary of r94990, stop abusing...catrope11:23, 19 August 2011

Status & tagging log