]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #2463 Added trim for leading /s to avoid //s when passing elgg_normalize_url...
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 4 Nov 2010 20:16:16 +0000 (20:16 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 4 Nov 2010 20:16:16 +0000 (20:16 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7237 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/output.php

index cac7eeb5bbf8060d7f3bf5e696d8fbef3beb9f9a..6f4ef7b962af9adbd1b02a80a092d659d0617d89 100644 (file)
@@ -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, '/');
        }
 }