From 4c07fce7191ed5d9c393479406cce454a9c4a7cc Mon Sep 17 00:00:00 2001 From: vlakoff Date: Fri, 25 Oct 2013 01:20:32 +0200 Subject: Implement $protocol parameter in Config base_url() and site_url() methods Let's keep the implementation logic in one place. Improves 2023c3d05b042cf1322286d69557c2b8bf3bd8d5. --- system/helpers/url_helper.php | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'system/helpers') 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); } } -- cgit v1.2.3-24-g4f1b