[-] FO : Do not redirect on 301 when POST request

This commit is contained in:
gRoussac committed 2013-08-08 19:19:34 +02:00
1 parent e923455f6d
commit 9ccd9b7cad
1 file changed
+8 -11
+8 -11
View File
@@ -114,21 +114,18 @@ class FrontControllerCore extends Controller
$css_files = $this->css_files; $css_files = $this->css_files;
$js_files = $this->js_files; $js_files = $this->js_files;
if ($this->ssl && !Tools::usingSecureMode() && Configuration::get('PS_SSL_ENABLED')) // If we call a SSL controller without SSL or a non SSL controller with SSL, we redirect with the right protocol
{ if (Configuration::get('PS_SSL_ENABLED') && ($_SERVER['REQUEST_METHOD'] != 'POST') && $this->ssl != Tools::usingSecureMode())
{
header('HTTP/1.1 301 Moved Permanently'); header('HTTP/1.1 301 Moved Permanently');
header('Cache-Control: no-cache'); header('Cache-Control: no-cache');
header('Location: '.Tools::getShopDomainSsl(true).$_SERVER['REQUEST_URI']); if ($this->ssl)
header('Location: '.Tools::getShopDomainSsl(true).$_SERVER['REQUEST_URI']);
else
header('Location: '.Tools::getShopDomain(true).$_SERVER['REQUEST_URI']);
exit(); exit();
} }
elseif (Configuration::get('PS_SSL_ENABLED') && Tools::usingSecureMode() && !($this->ssl))
{
header('HTTP/1.1 301 Moved Permanently');
header('Cache-Control: no-cache');
header('Location: '.Tools::getShopDomain(true).$_SERVER['REQUEST_URI']);
exit();
}
if ($this->ajax) if ($this->ajax)
{ {
$this->display_header = false; $this->display_header = false;