r98195 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98194‎ | r98195 | r98196 >
Date:23:17, 26 September 2011
Author:catrope
Status:ok
Tags:
Comment:
1.18wmf1: MFT r98193, r98194
Modified paths:
  • /branches/wmf/1.18wmf1/includes/parser/Parser.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/includes/parser/Parser.php
@@ -2735,10 +2735,8 @@
27362736 case 'server':
27372737 return $wgServer;
27382738 case 'servername':
2739 - wfSuppressWarnings(); # May give an E_WARNING in PHP < 5.3.3
2740 - $serverName = parse_url( $wgServer, PHP_URL_HOST );
2741 - wfRestoreWarnings();
2742 - return $serverName ? $serverName : $wgServer;
 2739+ $serverParts = wfParseUrl( $wgServer );
 2740+ return $serverParts && isset( $serverParts['host'] ) ? $serverParts['host'] : $wgServer;
27432741 case 'scriptpath':
27442742 return $wgScriptPath;
27452743 case 'stylepath':

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r98193(bug 31176) {{SERVERNAME}} doesn't play nice with protocol-relative URLscatrope23:14, 26 September 2011
r98194Fix stupid typo in r98193, thanks Dantmancatrope23:16, 26 September 2011

Status & tagging log