diff --git a/include/class.http.php b/include/class.http.php index 8d4e7be2..5502e984 100644 --- a/include/class.http.php +++ b/include/class.http.php @@ -40,10 +40,15 @@ function response($code,$content,$contentType='text/html',$charset='UTF-8') { print $content; exit; } - - function redirect($url,$delay=0,$msg='') { - if(strstr($_SERVER['SERVER_SOFTWARE'], 'IIS')){ + function redirect($url,$delay=0,$msg='') { + + $iis = strpos($_SERVER['SERVER_SOFTWARE'], 'IIS') !== false; + @list($name, $version) = explode('/', $_SERVER['SERVER_SOFTWARE']); + // Legacy code for older versions of IIS that would not emit the + // correct HTTP status and headers when using the `Location` + // header alone + if ($iis && version_compare($version, '7.0', '<')) { header("Refresh: $delay; URL=$url"); }else{ header("Location: $url");