// Fix HTML validation on URLs (replace & per &)
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8355 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -39,7 +39,7 @@ class CmsControllerCore extends FrontController
|
||||
|
||||
if (Configuration::get('PS_CANONICAL_REDIRECT'))
|
||||
{
|
||||
if (Validate::isLoadedObject($this->cms) AND $canonicalURL = $this->context->link->getCMSLink($this->cms))
|
||||
if (Validate::isLoadedObject($this->cms) AND $canonicalURL = str_replace('&', '&', $this->context->link->getCMSLink($this->cms)))
|
||||
if (!preg_match('/^'.Tools::pRegexp($canonicalURL, '/').'([&?].*)?$/', Tools::getProtocol().$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']))
|
||||
{
|
||||
header('HTTP/1.0 301 Moved');
|
||||
@@ -47,7 +47,7 @@ class CmsControllerCore extends FrontController
|
||||
die('[Debug] This page has moved<br />Please use the following URL instead: <a href="'.$canonicalURL.'">'.$canonicalURL.'</a>');
|
||||
Tools::redirectLink($canonicalURL);
|
||||
}
|
||||
if (Validate::isLoadedObject($this->cms_category) AND $canonicalURL = $this->context->link->getCMSCategoryLink($this->cms_category))
|
||||
if (Validate::isLoadedObject($this->cms_category) AND $canonicalURL = str_replace('&', '&', $this->context->link->getCMSCategoryLink($this->cms_category)))
|
||||
if (!preg_match('/^'.Tools::pRegexp($canonicalURL, '/').'([&?].*)?$/', Tools::getProtocol().$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']))
|
||||
{
|
||||
header('HTTP/1.0 301 Moved');
|
||||
|
||||
Reference in New Issue
Block a user