diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-04 20:16:16 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-04 20:16:16 +0000 |
commit | a2511db0c9e2bf53d8c8bc8186b3f80c838d0879 (patch) | |
tree | 8c3156bae17ecdb0f43b4368e1231d6a17d50905 | |
parent | 0630ba0a2b8033d7b0f5953aac6344eee752ba04 (diff) | |
download | elgg-a2511db0c9e2bf53d8c8bc8186b3f80c838d0879.tar.gz elgg-a2511db0c9e2bf53d8c8bc8186b3f80c838d0879.tar.bz2 |
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
-rw-r--r-- | engine/lib/output.php | 6 |
1 files changed, 4 insertions, 2 deletions
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, '/'); } } |