diff options
author | vlakoff <vlakoff@gmail.com> | 2013-10-25 01:20:32 +0200 |
---|---|---|
committer | vlakoff <vlakoff@gmail.com> | 2013-10-25 01:20:32 +0200 |
commit | 4c07fce7191ed5d9c393479406cce454a9c4a7cc (patch) | |
tree | f4d91c411c62d511971085fd3edcf5f98c776d87 /system/helpers | |
parent | a587a939ce0b8e7d1dfe0830ac83d881e151d6e0 (diff) |
Implement $protocol parameter in Config base_url() and site_url() methods
Let's keep the implementation logic in one place.
Improves 2023c3d05b042cf1322286d69557c2b8bf3bd8d5.
Diffstat (limited to 'system/helpers')
-rw-r--r-- | system/helpers/url_helper.php | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index fbb4a1b24..b0f436840 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -52,14 +52,7 @@ if ( ! function_exists('site_url')) */ function site_url($uri = '', $protocol = NULL) { - $uri = get_instance()->config->site_url($uri); - - if (isset($protocol)) - { - return $protocol.substr($uri, strpos($uri, '://')); - } - - return $uri; + return get_instance()->config->site_url($uri, $protocol); } } @@ -80,14 +73,7 @@ if ( ! function_exists('base_url')) */ function base_url($uri = '', $protocol = NULL) { - $uri = get_instance()->config->base_url($uri); - - if (isset($protocol)) - { - return $protocol.substr($uri, strpos($uri, '://')); - } - - return $uri; + return get_instance()->config->base_url($uri, $protocol); } } |