summaryrefslogtreecommitdiffstats
path: root/system/helpers/html_helper.php
diff options
context:
space:
mode:
authorWilliam Poetra Yoga <30787981+wpyh@users.noreply.github.com>2018-05-30 05:04:01 +0200
committerGitHub <noreply@github.com>2018-05-30 05:04:01 +0200
commit605dcbc55ed4dfa1c8fb8ed659dc51b0710ff165 (patch)
treebb3533ef83271af4ad029292fd760bf2a8c10cff /system/helpers/html_helper.php
parente837b9b8705c222d49f86ab051d2df717d986c5b (diff)
Use Config::base_url() properly
Using the Config::slash_item() method, we get double forward slashes. For example, base_url = 'http://localhost:8080/' and asset is '/assets/my_asset.css', then the generated URL would be 'http://localhost:8080//assets/my_asset.css'. This patch fixes that, so the generated URL would be 'http://localhost:8080/assets/my_asset.css'. There is actually already an analog example in the case if index_page === TRUE, where the site_url() function is used.
Diffstat (limited to 'system/helpers/html_helper.php')
-rw-r--r--system/helpers/html_helper.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php
index c935f2619..985c68c8a 100644
--- a/system/helpers/html_helper.php
+++ b/system/helpers/html_helper.php
@@ -200,7 +200,7 @@ if ( ! function_exists('img'))
}
else
{
- $img .= ' src="'.get_instance()->config->slash_item('base_url').$v.'"';
+ $img .= ' src="'.get_instance()->config->base_url($v).'"';
}
}
else
@@ -292,7 +292,7 @@ if ( ! function_exists('link_tag'))
}
else
{
- $link .= 'href="'.$CI->config->slash_item('base_url').$v.'" ';
+ $link .= 'href="'.$CI->config->base_url($v).'" ';
}
}
else
@@ -313,7 +313,7 @@ if ( ! function_exists('link_tag'))
}
else
{
- $link .= 'href="'.$CI->config->slash_item('base_url').$href.'" ';
+ $link .= 'href="'.$CI->config->base_url($href).'" ';
}
$link .= 'rel="'.$rel.'" type="'.$type.'" ';