From 087a54a673b0f32265da209b86badd247da181bf Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 1 Oct 2009 19:04:26 +0000 Subject: - Patch #578520 by sun, c960657 | mfb, Dries, catch, mattyoung: Changed Make in url() only accept an array. --- includes/common.inc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'includes') 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']); } -- cgit v1.2.3