This commit is contained in:
Marion Muszynski 2017-03-09 10:53:26 +01:00
parent 8051a5e9c2
commit f1e3151dac
2 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@ class FrontController extends FrontControllerCore {
public function __construct() {
global $useSSL;
if($_SERVER['SERVER_PORT'] == _PS_SSL_PORT_ || !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' || Configuration::get('PS_SSL_ENABLED')) {
if($_SERVER['SERVER_PORT'] == _PS_SSL_PORT_ || !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PORT'] == '443') || Configuration::get('PS_SSL_ENABLED')) {
$useSSL = $this->ssl = TRUE;
} else {
$useSSL = $this->ssl;
@ -319,7 +319,7 @@ class FrontController extends FrontControllerCore {
if(isset($this->php_self) && !empty($this->php_self)) {
// $_SERVER['HTTP_HOST'] must be replaced by the real canonical domain
$canonicalURL = $link->getPageLink($this->php_self, $this->ssl, $cookie->id_lang);
if(!Tools::getValue('ajax') && !preg_match('/^'.Tools::pRegexp($canonicalURL, '/').'([&?].*)?$/', (($_SERVER['SERVER_PORT'] == _PS_SSL_PORT_ || !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' || Configuration::get('PS_SSL_ENABLED'))? 'https://': 'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'])) {
if(!Tools::getValue('ajax') && !preg_match('/^'.Tools::pRegexp($canonicalURL, '/').'([&?].*)?$/', (($_SERVER['SERVER_PORT'] == _PS_SSL_PORT_ || !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PORT'] == '443') || Configuration::get('PS_SSL_ENABLED'))? 'https://': 'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'])) {
header('HTTP/1.0 301 Moved');
$params = '';
$excludedKey = array('isolang', 'id_lang');

View File

@ -29,7 +29,7 @@ class Link extends LinkCore
return $base._MODULE_DIR_.'/'.Module::getModuleNameFromClass('AdminGuidePosts').'/';
}
public function getPageLinkSsl($filename, $ssl = false, $id_lang = NULL)
public function getPageLink($filename, $ssl = false, $id_lang = NULL)
{
global $cookie;
if ($id_lang == NULL)