Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http: Legacy versions of IIS redirect incorrectly #874

Merged
merged 1 commit into from
Jan 3, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions include/class.http.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down