summaryrefslogtreecommitdiffstats
path: root/system/helpers/url_helper.php
diff options
context:
space:
mode:
authorBrandon Jones <brandon.jones@ellislab.com>2011-11-07 21:51:05 +0100
committerBrandon Jones <brandon.jones@ellislab.com>2011-11-07 21:51:05 +0100
commit50e5dbb6079380d2e79e2fbbb39adfeaa40a33ea (patch)
tree0625470ff5cd1eff555821cc9b2593a3be760676 /system/helpers/url_helper.php
parentb1b2e0ccc17193e0f765857ff65a66856e984b19 (diff)
Adding auto-detection of best redirect method in url_helper.
Diffstat (limited to 'system/helpers/url_helper.php')
-rwxr-xr-xsystem/helpers/url_helper.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php
index bfed96c6e..5d907d00e 100755
--- a/system/helpers/url_helper.php
+++ b/system/helpers/url_helper.php
@@ -544,13 +544,19 @@ if ( ! function_exists('url_title'))
*/
if ( ! function_exists('redirect'))
{
- function redirect($uri = '', $method = 'location', $http_response_code = 302)
+ function redirect($uri = '', $method = 'auto', $http_response_code = 302)
{
if ( ! preg_match('#^https?://#i', $uri))
{
$uri = site_url($uri);
}
+ // IIS environment likely? Use 'refresh' for better compatibility
+ if (DIRECTORY_SEPARATOR != '/' && $method == 'auto')
+ {
+ $method = 'refresh';
+ }
+
switch($method)
{
case 'refresh' : header("Refresh:0;url=".$uri);