[*] FO: Allow to enable SSL on all the pages

This commit is contained in:
Rémi Gaillard
2013-09-18 16:30:34 +02:00
parent 3aec242600
commit 0452979ce7
3 changed files with 40 additions and 53 deletions

View File

@@ -65,6 +65,9 @@ class FrontControllerCore extends Controller
parent::__construct();
if (Configuration::get('PS_SSL_ENABLED') && Configuration::get('PS_SSL_ENABLED_EVERYWHERE'))
$this->ssl = true;
if (isset($useSSL))
$this->ssl = $useSSL;
else
@@ -597,7 +600,7 @@ class FrontControllerCore extends Controller
if (!$canonical_url || !Configuration::get('PS_CANONICAL_REDIRECT') || strtoupper($_SERVER['REQUEST_METHOD']) != 'GET' || Tools::getValue('live_edit'))
return;
$match_url = (($this->ssl && Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$match_url = (($this->ssl) ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$match_url = rawurldecode($match_url);
if (!preg_match('/^'.Tools::pRegexp(rawurldecode($canonical_url), '/').'([&?].*)?$/', $match_url))
{