summaryrefslogtreecommitdiffstats
path: root/system/helpers/url_helper.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/helpers/url_helper.php')
-rw-r--r--system/helpers/url_helper.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php
index 6c3bc837a..5be43300e 100644
--- a/system/helpers/url_helper.php
+++ b/system/helpers/url_helper.php
@@ -528,11 +528,16 @@ if ( ! function_exists('redirect'))
{
function redirect($uri = '', $method = 'location', $http_response_code = 302)
{
+ if ( ! preg_match('#^https?://#i', $uri))
+ {
+ $uri = site_url($uri);
+ }
+
switch($method)
{
- case 'refresh' : header("Refresh:0;url=".site_url($uri));
+ case 'refresh' : header("Refresh:0;url=".$uri);
break;
- default : header("Location: ".site_url($uri), TRUE, $http_response_code);
+ default : header("Location: ".$uri, TRUE, $http_response_code);
break;
}
exit;