Re: INFO: Bad HTTP_REFERER
I would consider this kind of solution as "save enough"...
I'm calling the forum by a IFRAME and the referer check (complete path...) failes - but its still my domain...
My modified function checks only the HOST in the REFERER:
function confirm_referrer($script)
{
global $pun_config, $lang_common;
$HTTP_HOST = str_replace("www.","",getenv('HTTP_HOST'));
$BASE_URL = str_replace("www.","",$pun_config['o_base_url']).'/'.$script;
if ( empty($_SERVER['HTTP_REFERER']) ||
!empty($_SERVER['HTTP_REFERER']) && !preg_match("~^http[s]?://".$HTTP_HOST."~i",$_SERVER['HTTP_REFERER']) ||
!preg_match("~^http[s]?://".$HTTP_HOST."~i",$BASE_URL))
{
message($lang_common['Bad referrer']);
}
}
Great SoftWare anyway - thanxs a lot ;-)
Greetz Uli