Topic: Regular expressions in confirm_refererer ??
Hello guys,
I've done an URL-rewriting modification on my BB which makes topics have url like http://[mytld]/##-Forum-Name/t###-thread-name.html
Since then, I can neither lock, or move threads because of the referer confirmation.
function confirm_referrer($script)
{
global $pun_config, $lang_common;
if (!preg_match('#^'.preg_quote(str_replace('www.', '', $pun_config['o_base_url']).'/'.$script, '#').'#i', str_replace('www.', '', (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''))))
message($lang_common['Bad referrer']);
}
I'm quite bad with regex and I have a quite hard time figuring out how to do this one...
Anyone can help?
Pier-Luc