Improved register_globals handling

This commit is contained in:
root 2008-08-25 20:47:49 +00:00
parent b71a0a3a4b
commit a8e97840d7

View file

@ -37,25 +37,31 @@
require_once($_SESSION['_config']['filepath']."/includes/mysql.php");
if($_SERVER['HTTP_HOST'] != $_SESSION['_config']['normalhostname'] &&
if(array_key_exists('HTTP_HOST',$_SERVER) &&
$_SERVER['HTTP_HOST'] != $_SESSION['_config']['normalhostname'] &&
$_SERVER['HTTP_HOST'] != $_SESSION['_config']['securehostname'] &&
$_SERVER['HTTP_HOST'] != $_SESSION['_config']['tverify'] &&
$_SERVER['HTTP_HOST'] != "stamp.cacert.org")
{
if($_SERVER['HTTPS'] == "on")
if(array_key_exists('HTTPS',$_SERVER) && $_SERVER['HTTPS'] == "on")
header("location: https://".$_SESSION['_config']['normalhostname']);
else
header("location: http://".$_SESSION['_config']['normalhostname']);
exit;
}
if(($_SERVER['HTTP_HOST'] == $_SESSION['_config']['securehostname'] ||
$_SERVER['HTTP_HOST'] == $_SESSION['_config']['tverify']) &&
$_SERVER['HTTP_HOST'] != "stamp.cacert.org" &&
$_SERVER['HTTPS'] != "on")
if(array_key_exists('HTTP_HOST',$_SERVER) &&
($_SERVER['HTTP_HOST'] == $_SESSION['_config']['securehostname'] ||
$_SERVER['HTTP_HOST'] == $_SESSION['_config']['tverify']))
{
header("location: https://".$_SERVER['HTTP_HOST']);
exit;
if(array_key_exists('HTTPS',$_SERVER) && $_SERVER['HTTPS'] == "on")
{
}
else
{
header("location: https://".$_SERVER['HTTP_HOST']);
exit;
}
}
$lang = "";