// Fix & - theme is not w3c valid anymore for now

This commit is contained in:
rMalie
2011-09-14 09:23:32 +00:00
parent 7884bceeeb
commit dfdd99da40
6 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -325,7 +325,7 @@ class DispatcherCore
if (!isset($this->routes[$route_id])) if (!isset($this->routes[$route_id]))
{ {
$query = http_build_query($params); $query = http_build_query($params);
return ($route_id == 'index') ? 'index.php'.(($query) ? '?'.$query : '') : 'index.php?controller='.$route_id.(($query) ? '&'.$query : ''); return ($route_id == 'index') ? 'index.php'.(($query) ? '?'.$query : '') : 'index.php?controller='.$route_id.(($query) ? '&'.$query : '');
} }
$route = $this->routes[$route_id]; $route = $this->routes[$route_id];
@@ -360,7 +360,7 @@ class DispatcherCore
} }
// Build a classic url index.php?controller=foo&... // Build a classic url index.php?controller=foo&...
else else
$url = 'index.php?controller='.$route['controller'].(($query_params) ? '&'.http_build_query($query_params) : ''); $url = 'index.php?controller='.$route['controller'].(($query_params) ? '&'.http_build_query($query_params) : '');
return $url; return $url;
} }
+1 -1
View File
@@ -383,7 +383,7 @@ class FrontControllerCore
{ {
// $_SERVER['HTTP_HOST'] must be replaced by the real canonical domain // $_SERVER['HTTP_HOST'] must be replaced by the real canonical domain
$canonicalURL = str_replace('&', '&', $this->context->link->getPageLink($this->php_self, $this->ssl, $this->context->language->id)); $canonicalURL = $this->context->link->getPageLink($this->php_self, $this->ssl, $this->context->language->id);
if (!Tools::getValue('ajax') && !preg_match('/^'.Tools::pRegexp($canonicalURL, '/').'([&?].*)?$/', (($this->ssl AND Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'])) if (!Tools::getValue('ajax') && !preg_match('/^'.Tools::pRegexp($canonicalURL, '/').'([&?].*)?$/', (($this->ssl AND Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']))
{ {
header('HTTP/1.0 301 Moved'); header('HTTP/1.0 301 Moved');
+2 -2
View File
@@ -39,7 +39,7 @@ class CmsControllerCore extends FrontController
if (Configuration::get('PS_CANONICAL_REDIRECT')) if (Configuration::get('PS_CANONICAL_REDIRECT'))
{ {
if (Validate::isLoadedObject($this->cms) AND $canonicalURL = str_replace('&', '&', $this->context->link->getCMSLink($this->cms))) if (Validate::isLoadedObject($this->cms) AND $canonicalURL = $this->context->link->getCMSLink($this->cms))
if (!preg_match('/^'.Tools::pRegexp($canonicalURL, '/').'([&?].*)?$/', Tools::getProtocol().$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'])) if (!preg_match('/^'.Tools::pRegexp($canonicalURL, '/').'([&?].*)?$/', Tools::getProtocol().$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']))
{ {
header('HTTP/1.0 301 Moved'); 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>'); die('[Debug] This page has moved<br />Please use the following URL instead: <a href="'.$canonicalURL.'">'.$canonicalURL.'</a>');
Tools::redirectLink($canonicalURL); Tools::redirectLink($canonicalURL);
} }
if (Validate::isLoadedObject($this->cms_category) AND $canonicalURL = str_replace('&amp;', '&', $this->context->link->getCMSCategoryLink($this->cms_category))) if (Validate::isLoadedObject($this->cms_category) AND $canonicalURL = $this->context->link->getCMSCategoryLink($this->cms_category))
if (!preg_match('/^'.Tools::pRegexp($canonicalURL, '/').'([&?].*)?$/', Tools::getProtocol().$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'])) if (!preg_match('/^'.Tools::pRegexp($canonicalURL, '/').'([&?].*)?$/', Tools::getProtocol().$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']))
{ {
header('HTTP/1.0 301 Moved'); header('HTTP/1.0 301 Moved');
+1 -1
View File
@@ -40,7 +40,7 @@ class ManufacturerControllerCore extends FrontController
{ {
if (Validate::isLoadedObject($this->manufacturer)) if (Validate::isLoadedObject($this->manufacturer))
{ {
$canonicalURL = str_replace('&amp;', '&', $this->context->link->getManufacturerLink($this->manufacturer)); $canonicalURL = $this->context->link->getManufacturerLink($this->manufacturer);
if (!preg_match('/^'.Tools::pRegexp($canonicalURL, '/').'([&?].*)?$/', Tools::getProtocol().$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'])) if (!preg_match('/^'.Tools::pRegexp($canonicalURL, '/').'([&?].*)?$/', Tools::getProtocol().$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']))
{ {
header('HTTP/1.0 301 Moved'); header('HTTP/1.0 301 Moved');
+1 -1
View File
@@ -56,7 +56,7 @@ class ProductControllerCore extends FrontController
// $_SERVER['HTTP_HOST'] must be replaced by the real canonical domain // $_SERVER['HTTP_HOST'] must be replaced by the real canonical domain
if (Validate::isLoadedObject($this->product)) if (Validate::isLoadedObject($this->product))
{ {
$canonicalURL = str_replace('&amp;', '&', $this->context->link->getProductLink($this->product)); $canonicalURL = $this->context->link->getProductLink($this->product);
if (!preg_match('/^'.Tools::pRegexp($canonicalURL, '/').'([&?].*)?$/', Tools::getProtocol().$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'])) if (!preg_match('/^'.Tools::pRegexp($canonicalURL, '/').'([&?].*)?$/', Tools::getProtocol().$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']))
{ {
header('HTTP/1.0 301 Moved'); header('HTTP/1.0 301 Moved');
+1 -1
View File
@@ -43,7 +43,7 @@ class SupplierControllerCore extends FrontController
{ {
if (Validate::isLoadedObject($this->supplier)) if (Validate::isLoadedObject($this->supplier))
{ {
$canonicalURL = str_replace('&amp;', '&', $this->context->link->getSupplierLink($this->supplier)); $canonicalURL = $this->context->link->getSupplierLink($this->supplier);
if (!preg_match('/^'.Tools::pRegexp($canonicalURL, '/').'([&?].*)?$/', Tools::getProtocol().$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'])) if (!preg_match('/^'.Tools::pRegexp($canonicalURL, '/').'([&?].*)?$/', Tools::getProtocol().$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']))
{ {
header('HTTP/1.0 301 Moved'); header('HTTP/1.0 301 Moved');