Per CR on r44412 and my promise in the commit summary of r94990, stop abusing $wgInte...
authorRoan Kattouw <catrope@users.mediawiki.org>
Fri, 19 Aug 2011 11:23:17 +0000 (11:23 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Fri, 19 Aug 2011 11:23:17 +0000 (11:23 +0000)
commitfbc65f8972fc08a410acd13cb7e3d39059cadcaf
tree3c1c0c704add20339c31a5faf0d0093416ae9c8f
parentcd47443fcfb2ef677e27b35fab1c2749e9b3378f
Per CR on r44412 and my promise in the commit summary of r94990, stop abusing $wgInternalServer (intended for Squid URLs) for IRC/e-mail URLs and introduce $wgCanonicalServer for these purposes instead. This revision introduces two new hooks for WMF hacks, in exchange for making the core code saner.

* Introduce $wgCanonicalServer, which should typically be a fully qualified version of $wgServer but in practice can be anything that you'd like to be used in IRC/e-mail notifs
** Default value is $wgServer, expanded to http:// if protocol-relative
** This means you can easily set HTTPS as the 'default' protocol to use in IRC and e-mail notifs by setting $wgCanonicalServer to https://example.com
* Introduce Title::getCanonicalURL(). Similar to getInternalURL(), including a hook for WMF usage (which will be needed as long as secure.wikimedia.org is used)
** Also add escapeCanonicalURL(). Due to some ridiculous accident of history, the other escapeFooURL() functions don't have a $variant parameter; I decided not to follow that bad example
* Reinstate the spirit of r44406 and r44412: instead of calling getInternalURL() (or getCanonicalURL()) and regexing the title parameter out, obtain the path to index.php using $wgCanonicalServer . $wgScript and append params to that. Sadly, we need to add a hook here to support the secure server hack for WMF, but that's the price of saner code in this case
* Introduce the {{canonicalurl:}} and {{canonicalurle:}} parser functions, which work just like {{fullurl:}} and {{fullurle:}} except that they use getCanonicalURL() instead of getFullURL()
* Use {{canonicalurl:}} in the enotif_body message, fixing bug 29993 (protocol-relative URLs appear in e-mail notifications)
includes/DefaultSettings.php
includes/RecentChange.php
includes/Setup.php
includes/Title.php
includes/parser/CoreParserFunctions.php
languages/messages/MessagesEn.php