summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-10-01 19:04:26 +0000
committerDries Buytaert <dries@buytaert.net>2009-10-01 19:04:26 +0000
commit087a54a673b0f32265da209b86badd247da181bf (patch)
treec11ada431091251ade4b37dcf195693d304660dd /includes
parent67e96428168dc612f7d4a8161a07bf686bff8db0 (diff)
downloadbrdo-087a54a673b0f32265da209b86badd247da181bf.tar.gz
brdo-087a54a673b0f32265da209b86badd247da181bf.tar.bz2
- Patch #578520 by sun, c960657 | mfb, Dries, catch, mattyoung: Changed Make in url() only accept an array.
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc7
1 files changed, 5 insertions, 2 deletions
diff --git a/includes/common.inc b/includes/common.inc
index ec5d34cda..51918f062 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -520,8 +520,11 @@ function drupal_parse_url($url) {
}
// Internal URLs.
else {
- $parts = parse_url($url);
- $options['path'] = $parts['path'];
+ // parse_url() does not support relative URLs, so make it absolute. E.g. the
+ // relative URL "foo/bar:1" isn't properly parsed.
+ $parts = parse_url('http://example.com/' . $url);
+ // Strip the leading slash that was just added.
+ $options['path'] = substr($parts['path'], 1);
if (isset($parts['query'])) {
parse_str($parts['query'], $options['query']);
}