From a2511db0c9e2bf53d8c8bc8186b3f80c838d0879 Mon Sep 17 00:00:00 2001 From: brettp Date: Thu, 4 Nov 2010 20:16:16 +0000 Subject: Refs #2463 Added trim for leading /s to avoid //s when passing elgg_normalize_url('/mod/some/file.php'). git-svn-id: http://code.elgg.org/elgg/trunk@7237 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/output.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'engine/lib') diff --git a/engine/lib/output.php b/engine/lib/output.php index cac7eeb5b..6f4ef7b96 100644 --- a/engine/lib/output.php +++ b/engine/lib/output.php @@ -150,7 +150,7 @@ function elgg_format_url($url) { * elgg_normalize_url('http://google.com/'); // no change * elgg_normalize_url('//google.com/'); // no change * - * @param string $url The URL to normalize + * @param string $url The URL to normalize * * @return string The absolute url */ @@ -167,7 +167,9 @@ function elgg_normalize_url($url) { // 'pg/page/handler', 'mod/plugin/file.php' else { - return elgg_get_site_url().$url; + // trim off any leading / because the site URL is stored + // with a trailing / + return elgg_get_site_url() . ltrim($url, '/'); } } -- cgit v1.2.3