summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/helpers/url_helper.php9
-rw-r--r--user_guide/changelog.html1
2 files changed, 8 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;
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 7a26cb39a..48f356703 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -84,6 +84,7 @@ SVN Revision: </p>
<li>Added a doctype() function to the <a href="helpers/html_helper.html">HTML helper</a>.</li>
<li>Added ability to force lowercase for <kbd>url_title()</kbd> in the <a href="helpers/url_helper.html">URL helper</a>.</li>
<li>Changed the default "type" of <kbd>form_button()</kbd> to "button" from "submit" in the <a href="helpers/form_helper.html">form helper</a>.</li>
+ <li>Changed redirect() in the URL helper to allow redirections to URLs outside of the CI site.</li>
</ul>
</li>
<li>Other Changes