From 628bb29401aa5a1f35a94ad2425fb0eb8dfc4ecf Mon Sep 17 00:00:00 2001 From: MathiasReker Date: Sun, 9 Dec 2018 15:06:40 +0100 Subject: [PATCH 1/3] Fix use of protocol --- classes/pdf/HTMLTemplate.php | 2 +- classes/pdf/HTMLTemplateSupplyOrderForm.php | 2 +- config/defines_uri.inc.php | 2 +- controllers/admin/AdminCurrenciesController.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/pdf/HTMLTemplate.php b/classes/pdf/HTMLTemplate.php index 22f0be346d7fe..73f0d07d6e0c1 100755 --- a/classes/pdf/HTMLTemplate.php +++ b/classes/pdf/HTMLTemplate.php @@ -136,7 +136,7 @@ public function assignCommonHeaderData() $this->smarty->assign(array( 'logo_path' => $path_logo, - 'img_ps_dir' => 'http://' . Tools::getMediaServer(_PS_IMG_) . _PS_IMG_, + 'img_ps_dir' => Tools::getShopProtocol() . Tools::getMediaServer(_PS_IMG_) . _PS_IMG_, 'img_update_time' => Configuration::get('PS_IMG_UPDATE_TIME'), 'date' => $this->date, 'title' => $this->title, diff --git a/classes/pdf/HTMLTemplateSupplyOrderForm.php b/classes/pdf/HTMLTemplateSupplyOrderForm.php index 73eada3667f11..a6c2ae1b9c1aa 100644 --- a/classes/pdf/HTMLTemplateSupplyOrderForm.php +++ b/classes/pdf/HTMLTemplateSupplyOrderForm.php @@ -174,7 +174,7 @@ public function getHeader() $this->smarty->assign(array( 'logo_path' => $path_logo, - 'img_ps_dir' => 'http://' . Tools::getMediaServer(_PS_IMG_) . _PS_IMG_, + 'img_ps_dir' => Tools::getShopProtocol() . Tools::getMediaServer(_PS_IMG_) . _PS_IMG_, 'img_update_time' => Configuration::get('PS_IMG_UPDATE_TIME'), 'title' => $this->title, 'reference' => $this->supply_order->reference, diff --git a/config/defines_uri.inc.php b/config/defines_uri.inc.php index 18b0c158051d7..a480014b5219f 100644 --- a/config/defines_uri.inc.php +++ b/config/defines_uri.inc.php @@ -66,7 +66,7 @@ /* Define API URLs if not defined before */ Tools::safeDefine('_PS_API_DOMAIN_', 'api.prestashop.com'); -Tools::safeDefine('_PS_API_URL_', 'http://'._PS_API_DOMAIN_); +Tools::safeDefine('_PS_API_URL_', Tools::getShopProtocol() . _PS_API_DOMAIN_); Tools::safeDefine('_PS_TAB_MODULE_LIST_URL_', _PS_API_URL_.'/xml/tab_modules_list_17.xml'); Tools::safeDefine('_PS_API_MODULES_LIST_16_', _PS_API_DOMAIN_.'/xml/modules_list_16.xml'); Tools::safeDefine('_PS_CURRENCY_FEED_URL_', _PS_API_URL_.'/xml/currencies.xml'); diff --git a/controllers/admin/AdminCurrenciesController.php b/controllers/admin/AdminCurrenciesController.php index a98755986c3c7..0b0c7bebf9127 100644 --- a/controllers/admin/AdminCurrenciesController.php +++ b/controllers/admin/AdminCurrenciesController.php @@ -310,7 +310,7 @@ public function ajaxProcessCronjobLiveExchangeRate() $enable = (int) Tools::getValue('enable'); $config = Configuration::get('PS_ACTIVE_CRONJOB_EXCHANGE_RATE', null, null, $this->context->shop->id); - $cronJobUrl = 'http://' . ShopUrl::getMainShopDomain($this->context->shop->id) . __PS_BASE_URI__ . basename(_PS_ADMIN_DIR_) . '/cron_currency_rates.php?secure_key=' . md5(_COOKIE_KEY_ . Configuration::get('PS_SHOP_NAME')); + $cronJobUrl = Tools::getShopProtocol() . ShopUrl::getMainShopDomain($this->context->shop->id) . __PS_BASE_URI__ . basename(_PS_ADMIN_DIR_) . '/cron_currency_rates.php?secure_key=' . md5(_COOKIE_KEY_ . Configuration::get('PS_SHOP_NAME')); if ($config && $enable == 0) { Configuration::updateValue('PS_ACTIVE_CRONJOB_EXCHANGE_RATE', 0, false, null, $this->context->shop->id); From 36ec2c3acc33638f72575d760dce76f90b1e8fac Mon Sep 17 00:00:00 2001 From: MathiasReker Date: Sun, 9 Dec 2018 15:24:48 +0100 Subject: [PATCH 2/3] Revert a mistake --- config/defines_uri.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/defines_uri.inc.php b/config/defines_uri.inc.php index a480014b5219f..18b0c158051d7 100644 --- a/config/defines_uri.inc.php +++ b/config/defines_uri.inc.php @@ -66,7 +66,7 @@ /* Define API URLs if not defined before */ Tools::safeDefine('_PS_API_DOMAIN_', 'api.prestashop.com'); -Tools::safeDefine('_PS_API_URL_', Tools::getShopProtocol() . _PS_API_DOMAIN_); +Tools::safeDefine('_PS_API_URL_', 'http://'._PS_API_DOMAIN_); Tools::safeDefine('_PS_TAB_MODULE_LIST_URL_', _PS_API_URL_.'/xml/tab_modules_list_17.xml'); Tools::safeDefine('_PS_API_MODULES_LIST_16_', _PS_API_DOMAIN_.'/xml/modules_list_16.xml'); Tools::safeDefine('_PS_CURRENCY_FEED_URL_', _PS_API_URL_.'/xml/currencies.xml'); From 178e219d496bad08d5280ad6d5f1ca1ca1be398f Mon Sep 17 00:00:00 2001 From: Mathias Reker Date: Sun, 9 Dec 2018 17:02:42 +0100 Subject: [PATCH 3/3] Restart Travis CI --- classes/pdf/HTMLTemplate.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/pdf/HTMLTemplate.php b/classes/pdf/HTMLTemplate.php index 73f0d07d6e0c1..b71a6ded04c14 100755 --- a/classes/pdf/HTMLTemplate.php +++ b/classes/pdf/HTMLTemplate.php @@ -16,7 +16,7 @@ * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your - * needs please refer to http://www.prestashop.com for more information. + * needs please refer to https://www.prestashop.com for more information. * * @author PrestaShop SA * @copyright 2007-2018 PrestaShop SA