[-] MO : Fix bug #PSCFI-7055 do not relay on ".html" in referer to find previous category

This commit is contained in:
gRoussac
2013-05-14 16:46:03 +02:00
parent 4e8c5a24df
commit 8db48ed534
+1 -2
View File
@@ -53,10 +53,9 @@ class Feeder extends Module
function hookHeader($params)
{
if (!($id_category = (int)Tools::getValue('id_category')))
{
if (isset($_SERVER['HTTP_REFERER']) && preg_match('!^(.*)\/([0-9]+)\-(.*[^\.])|(.*)id_category=([0-9]+)(.*)$!', $_SERVER['HTTP_REFERER'], $regs) && !strstr($_SERVER['HTTP_REFERER'], '.html'))
if (isset($_SERVER['HTTP_REFERER']) && strstr($_SERVER['HTTP_REFERER'], Tools::getHttpHost()) && preg_match('!^(.*)\/([0-9]+)\-(.*[^\.])|(.*)id_category=([0-9]+)(.*)$!', $_SERVER['HTTP_REFERER'], $regs))
{
if (isset($regs[2]) && is_numeric($regs[2]))
$id_category = (int)($regs[2]);