Skip to content
Snippets Groups Projects
Commit da3d53a8 authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #874 from greezybacon/issue/iis-refresh


http: Legacy versions of IIS redirect incorrectly

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents eadeffe7 176af908
No related branches found
No related tags found
No related merge requests found
......@@ -40,10 +40,15 @@ class Http {
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");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment