
Originally Posted by
Nick1973
No there isn't
Because of the use of the tilde in the HTTP_SERVER string, recommend modifying:
Code:
if (isset($_SERVER['HTTP_REFERER']) && preg_match("~^".HTTP_SERVER."~i", $_SERVER['HTTP_REFERER']) ) { //if (isset($_SERVER['HTTP_REFERER']) && strstr($_SERVER['HTTP_REFERER'], str_replace(array('http://', 'https://'), '', HTTP_SERVER) ) ) { $link= $_SERVER['HTTP_REFERER']; } else { $link = zen_href_link(FILENAME_DEFAULT); } $_SESSION['navigation'] = new navigationHistory; }
To:
Code:
if (isset($_SERVER['HTTP_REFERER']) && preg_match("~^".preg_quote(HTTP_SERVER, "~")."~i", $_SERVER['HTTP_REFERER']) ) { //if (isset($_SERVER['HTTP_REFERER']) && strstr($_SERVER['HTTP_REFERER'], str_replace(array('http://', 'https://'), '', HTTP_SERVER) ) ) { $link= $_SERVER['HTTP_REFERER']; } else { $link = zen_href_link(FILENAME_DEFAULT); } $_SESSION['navigation'] = new navigationHistory; }
I don't see any other instance on the catalog side where this style of preg_match is used against that specific string. I didn't look on the admin side. Note, that based on the error log that the page to be loaded was a page not found page. Why that particular direction was chosen I do not know based on what has been provided or what has been performed to generate URIs, but the above would prevent running into a clash. An alternative to adding in the preg_quote function is to modify the two uses of the tilde to say a non-uri like character, perhaps a semi-colon (;) or some other "odd" character.
Bookmarks