PHP 8.0.30
Undefined array key "HTTP_REFERER"
the if not already redirected does not work on logout... why does it think it is a differet site?
}
*/
if ($login_http_or_https == 'https') {
if ($user->state == 'in') { // if the user is logged in
$redirectto = 'Location: https://'.$config_urlbase.$_SERVER['REQUEST_URI'].'&switchedtosecure=1'.$passOnSecureSwitch;
// if the page reffered to by the same site
if ( '//'.$config_urlbase == substr(str_replace(array('http:','https:'),array('',''),$_SERVER["HTTP_REFERER"]),0,2+strlen($config_urlbase))) {
if (substr($_SERVER["HTTP_REFERER"],0,5) == 'http:') {
if ($_GET['switchedtosecure'] == 1) $temp = 0; else header( $redirectto );
}
} else { //if the page was reffered to by someone else, or was typed in.
//if the page was already redirected do nothing, otherwise redirect
if ($_GET['switchedtosecure'] == 1) $temp = 0; else header( $redirectto );
}
} else { // if the user is not logged in
$redirectto = 'Location: http://'.$config_urlbase.$_SERVER['REQUEST_URI'].'&switchedtoregular=1';
// if the page reffered to by the same site
if ( '//'.$config_urlbase == substr(str_replace(array('http:','https:'),array('',''),$_SERVER["HTTP_REFERER"]),0,2+strlen($config_urlbase))) {
if (substr($_SERVER["HTTP_REFERER"],0,5) == 'https') {
if ($_GET['switchedtoregular'] == 1) $temp = 0; header( $redirectto );
}
} /*else { //if the page was reffered to by someone else, or was typed in.
//if the page was already redirected do nothing, otherwise redirect
if ($_GET['switchedtoregular'] == 1) $temp = 0; else header( $redirectto );
} BREAKS ON LOG OUT IF UNCOMMENTED */
}
}
?>
Request
http://2007.solarteam.org/central/page.php/?id=439
GET
curl "http://2007.solarteam.org/central/page.php/?id=439" \
-X GET \
-H 'cf-ray: 927fa64a1ef922b9-ORD' \
-H 'x-forwarded-for: 3.144.228.87' \
-H 'host: 2007.solarteam.org' \
-H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' \
-H 'accept-encoding: gzip' \
-H 'cf-ipcountry: US' \
-H 'x-forwarded-proto: http' \
-H 'user-agent: Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)' \
-H 'upgrade-insecure-requests: 1' \
-H 'cf-visitor: {"scheme":"http"}' \
-H 'cache-control: no-cache' \
-H 'pragma: no-cache' \
-H 'cf-connecting-ip: 3.144.228.87' \
-H 'cdn-loop: cloudflare; loops=1' \
-H 'connection: Keep-Alive';
Browser
Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Headers
- cf-ray
927fa64a1ef922b9-ORD
- x-forwarded-for
3.144.228.87
- host
2007.solarteam.org
- accept
text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
- accept-encoding
gzip
- cf-ipcountry
US
- x-forwarded-proto
http
- user-agent
Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
- upgrade-insecure-requests
1
- cf-visitor
{"scheme":"http"}
- cache-control
no-cache
- pragma
no-cache
- cf-connecting-ip
3.144.228.87
- cdn-loop
cloudflare; loops=1
- connection
Keep-Alive