r92028 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92027‎ | r92028 | r92029 >
Date:00:03, 13 July 2011
Author:catrope
Status:ok
Tags:needs-php-test 
Comment:
Now that wfParseUrl() can handle protocol-relative URLs, make wfExpandUrl() work in cases where it's fed a protocol-relative URL and $wgServer is also protocol-relative.
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -437,7 +437,7 @@
438438 global $wgServer;
439439 if( substr( $url, 0, 2 ) == '//' ) {
440440 $bits = wfParseUrl( $wgServer );
441 - $scheme = $bits ? $bits['scheme'] : 'http';
 441+ $scheme = $bits && $bits['scheme'] !== '' ? $bits['scheme'] : 'http';
442442 return $scheme . ':' . $url;
443443 } elseif( substr( $url, 0, 1 ) == '/' ) {
444444 return $wgServer . $url;

Follow-up revisions

RevisionCommit summaryAuthorDate
r921721.17wmf1: MFT protocol-relative URL fixes: r91663, r92024, r92028, r92036, r9...catrope17:48, 14 July 2011

Status & tagging log