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:
894bdaa
)
Guard against parse_url() returning weird things in wfParseUrl(). This is not a probl...
author
Roan Kattouw
<catrope@users.mediawiki.org>
Fri, 12 Aug 2011 14:45:37 +0000
(14:45 +0000)
committer
Roan Kattouw
<catrope@users.mediawiki.org>
Fri, 12 Aug 2011 14:45:37 +0000
(14:45 +0000)
includes/GlobalFunctions.php
patch
|
blob
|
history
diff --git
a/includes/GlobalFunctions.php
b/includes/GlobalFunctions.php
index
98a1ea7
..
3c48d72
100644
(file)
--- a/
includes/GlobalFunctions.php
+++ b/
includes/GlobalFunctions.php
@@
-516,7
+516,9
@@
function wfParseUrl( $url ) {
wfSuppressWarnings();
$bits = parse_url( $url );
wfRestoreWarnings();
- if ( !$bits ) {
+ // parse_url() returns an array without scheme for some invalid URLs, e.g.
+ // parse_url("%0Ahttp://example.com") == array( 'host' => '%0Ahttp', 'path' => 'example.com' )
+ if ( !$bits || !isset( $bits['scheme'] ) ) {
return false;
}