Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -2823,10 +2823,8 @@ |
2824 | 2824 | case 'server': |
2825 | 2825 | return $wgServer; |
2826 | 2826 | case 'servername': |
2827 | | - wfSuppressWarnings(); # May give an E_WARNING in PHP < 5.3.3 |
2828 | | - $serverName = parse_url( $wgServer, PHP_URL_HOST ); |
2829 | | - wfRestoreWarnings(); |
2830 | | - return $serverName ? $serverName : $wgServer; |
| 2827 | + $serverParts = wfParseUrl( $wgServer, PHP_URL_HOST ); |
| 2828 | + return $serverParts && isset( $serverParts['host'] ) ? $serverParts['host'] : $wgServer; |
2831 | 2829 | case 'scriptpath': |
2832 | 2830 | return $wgScriptPath; |
2833 | 2831 | case 'stylepath': |