From f6dc81d0f1c2f22eec107e0d15ff4b47be702bd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Wed, 18 Sep 2013 17:19:03 +0200 Subject: [PATCH] // small fix for SSL --- classes/Link.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/classes/Link.php b/classes/Link.php index 27a87cda0..cb207e6db 100644 --- a/classes/Link.php +++ b/classes/Link.php @@ -227,7 +227,7 @@ class LinkCore * @param int $id_lang * @return string */ - public function getCMSLink($cms, $alias = null, $ssl = false, $id_lang = null, $id_shop = null) + public function getCMSLink($cms, $alias = null, $ssl = null, $id_lang = null, $id_shop = null) { if (!$id_lang) $id_lang = Context::getContext()->language->id; @@ -334,7 +334,7 @@ class LinkCore * @param int $id_lang * @return string */ - public function getModuleLink($module, $controller = 'default', array $params = array(), $ssl = false, $id_lang = null, $id_shop = null) + public function getModuleLink($module, $controller = 'default', array $params = array(), $ssl = null, $id_lang = null, $id_shop = null) { if (!$id_lang) $id_lang = Context::getContext()->language->id; @@ -421,7 +421,7 @@ class LinkCore * * @return string Page link */ - public function getPageLink($controller, $ssl = false, $id_lang = null, $request = null, $request_url_encode = false, $id_shop = null) + public function getPageLink($controller, $ssl = null, $id_lang = null, $request = null, $request_url_encode = false, $id_shop = null) { $controller = Tools::strReplaceFirst('.php', '', $controller); if (!$id_lang) @@ -603,8 +603,17 @@ class LinkCore return Language::getIsoById($id_lang).'/'; } - protected function getBaseLink($id_shop = null, $ssl = true) + protected function getBaseLink($id_shop = null, $ssl = null) { + static $force_ssl = null; + + if ($ssl === null) + { + if ($force_ssl === null) + $force_ssl = (Configuration::get('PS_SSL_ENABLED') && Configuration::get('PS_SSL_ENABLED_EVERYWHERE')); + $ssl = $force_ssl; + } + if (Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE') && $id_shop !== null) $shop = new Shop($id_shop); else