dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
50305c2
)
(bug 31176) {{SERVERNAME}} doesn't play nice with protocol-relative URLs
author
Roan Kattouw
<catrope@users.mediawiki.org>
Mon, 26 Sep 2011 23:14:20 +0000
(23:14 +0000)
committer
Roan Kattouw
<catrope@users.mediawiki.org>
Mon, 26 Sep 2011 23:14:20 +0000
(23:14 +0000)
includes/parser/Parser.php
patch
|
blob
|
history
diff --git
a/includes/parser/Parser.php
b/includes/parser/Parser.php
index
a183101
..
1fdbdc9
100644
(file)
--- a/
includes/parser/Parser.php
+++ b/
includes/parser/Parser.php
@@
-2823,10
+2823,8
@@
class Parser {
case 'server':
return $wgServer;
case 'servername':
- wfSuppressWarnings(); # May give an E_WARNING in PHP < 5.3.3
- $serverName = parse_url( $wgServer, PHP_URL_HOST );
- wfRestoreWarnings();
- return $serverName ? $serverName : $wgServer;
+ $serverParts = wfParseUrl( $wgServer, PHP_URL_HOST );
+ return $serverParts && isset( $serverParts['host'] ) ? $serverParts['host'] : $wgServer;
case 'scriptpath':
return $wgScriptPath;
case 'stylepath':