Micro-optimization on base_url() & site_url()
diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php
index e82a51d..fbb4a1b 100644
--- a/system/helpers/url_helper.php
+++ b/system/helpers/url_helper.php
@@ -52,14 +52,14 @@
*/
function site_url($uri = '', $protocol = NULL)
{
- $site_url = get_instance()->config->site_url($uri);
+ $uri = get_instance()->config->site_url($uri);
if (isset($protocol))
{
- $site_url = $protocol.substr($site_url, strpos($site_url, '://'));
+ return $protocol.substr($uri, strpos($uri, '://'));
}
- return $site_url;
+ return $uri;
}
}
@@ -80,14 +80,14 @@
*/
function base_url($uri = '', $protocol = NULL)
{
- $base_url = get_instance()->config->base_url($uri);
+ $uri = get_instance()->config->base_url($uri);
if (isset($protocol))
{
- $base_url = $protocol.substr($base_url, strpos($base_url, '://'));
+ return $protocol.substr($uri, strpos($uri, '://'));
}
- return $base_url;
+ return $uri;
}
}