From 86d6e1bbb61357616247580595275123c7210d7d Mon Sep 17 00:00:00 2001 From: shreesh arora Date: Sat, 13 Mar 2021 16:47:41 +0530 Subject: [PATCH 1/7] changes for php7.4 --- classes/CartRule.php | 2 +- classes/Referrer.php | 2 +- controllers/admin/AdminAttributeGeneratorController.php | 2 +- controllers/admin/AdminSupplyOrdersController.php | 2 +- modules/blocklayered/blocklayered.php | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/classes/CartRule.php b/classes/CartRule.php index d93f70b8b..88670b0de 100644 --- a/classes/CartRule.php +++ b/classes/CartRule.php @@ -1220,7 +1220,7 @@ class CartRuleCore extends ObjectModel if ($type == 'shop') { $shops = Context::getContext()->employee->getAssociatedShops(); if (count($shops)) { - $shop_list = ' AND t.id_shop IN ('.implode(array_map('intval', $shops), ',').') '; + $shop_list = ' AND t.id_shop IN ('.implode(',', array_map('intval', $shops)).') '; } } diff --git a/classes/Referrer.php b/classes/Referrer.php index a37ee888c..e742d9c75 100644 --- a/classes/Referrer.php +++ b/classes/Referrer.php @@ -236,7 +236,7 @@ class ReferrerCore extends ObjectModel if ($implode) { $sql = 'SELECT COUNT(id_order) AS orders, SUM(total_paid_real / conversion_rate) AS sales FROM '._DB_PREFIX_.'orders - WHERE id_order IN ('.implode($implode, ',').') + WHERE id_order IN ('.implode(',', $implode).') '.Shop::addSqlRestriction(Shop::SHARE_ORDER).' AND valid = 1'; return Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql); diff --git a/controllers/admin/AdminAttributeGeneratorController.php b/controllers/admin/AdminAttributeGeneratorController.php index 7c3a69900..8eac6b357 100644 --- a/controllers/admin/AdminAttributeGeneratorController.php +++ b/controllers/admin/AdminAttributeGeneratorController.php @@ -76,7 +76,7 @@ class AdminAttributeGeneratorControllerCore extends AdminController protected static function createCombinations($list) { if (count($list) <= 1) { - return count($list) ? array_map(create_function('$v', 'return (array($v));'), $list[0]) : $list; + return count($list) ? array_map(function ($v) {return (array($v));}, $list[0]) : $list; } $res = array(); $first = array_pop($list); diff --git a/controllers/admin/AdminSupplyOrdersController.php b/controllers/admin/AdminSupplyOrdersController.php index cdae27c2a..a4b32add5 100644 --- a/controllers/admin/AdminSupplyOrdersController.php +++ b/controllers/admin/AdminSupplyOrdersController.php @@ -719,7 +719,7 @@ class AdminSupplyOrdersControllerCore extends AdminController } $this->tpl_form_vars['products_list'] = $products; - $this->tpl_form_vars['product_ids'] = implode($product_ids, '|'); + $this->tpl_form_vars['product_ids'] = implode('|', $product_ids); $this->tpl_form_vars['product_ids_to_delete'] = ''; $this->tpl_form_vars['supplier_id'] = $supply_order->id_supplier; $this->tpl_form_vars['currency'] = $currency; diff --git a/modules/blocklayered/blocklayered.php b/modules/blocklayered/blocklayered.php index 89c25af64..151954b49 100644 --- a/modules/blocklayered/blocklayered.php +++ b/modules/blocklayered/blocklayered.php @@ -1862,7 +1862,7 @@ class BlockLayered extends Module break; case 'manufacturer': - $query_filters_where .= ' AND p.id_manufacturer IN ('.implode($selected_filters['manufacturer'], ',').')'; + $query_filters_where .= ' AND p.id_manufacturer IN ('.implode(',', $selected_filters['manufacturer']).')'; break; case 'condition': @@ -2005,7 +2005,7 @@ class BlockLayered extends Module $this->products = array(); else { - $product_per_page = isset($this->context->cookie->nb_item_per_page) ? (int)$this->context->cookie->nb_item_per_page : Configuration::get('PS_PRODUCTS_PER_PAGE'); + $product_per_page = isset($this->context->cookie->nb_item_per_page) ? (int)$this->context->cookie->nb_item_per_page : Configuration::get('PS_PRODUCTS_PER_PAGE'); $n = (int)Tools::getValue('n', Configuration::get('PS_PRODUCTS_PER_PAGE')); $nb_day_new_product = (Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20); @@ -3049,8 +3049,8 @@ class BlockLayered extends Module $query_filters = ''; else { - array_walk($filter_value, create_function('&$id_manufacturer', '$id_manufacturer = (int)$id_manufacturer;')); - $query_filters = ' AND p.id_manufacturer IN ('.implode($filter_value, ',').')'; + array_walk($filter_value, function (&$id_manufacturer) {$id_manufacturer = (int)$id_manufacturer;}); + $query_filters = ' AND p.id_manufacturer IN ('.implode(',', $filter_value).')'; } if ($ignore_join) return array('where' => $query_filters); From 4130bdfbe874f3f0b849b9c5edb444afcb8c0e63 Mon Sep 17 00:00:00 2001 From: shreesh arora Date: Wed, 28 Apr 2021 21:00:13 +0530 Subject: [PATCH 2/7] compatibility changes for php7.4 --- classes/Blowfish.php | 2 +- classes/ConfigurationTest.php | 2 +- classes/Tools.php | 64 +------------------ config/defines.inc.php | 2 +- controllers/admin/AdminShopController.php | 22 +++---- .../admin/AdminTranslationsController.php | 4 +- 6 files changed, 19 insertions(+), 77 deletions(-) diff --git a/classes/Blowfish.php b/classes/Blowfish.php index d052820c2..a4aeba50a 100644 --- a/classes/Blowfish.php +++ b/classes/Blowfish.php @@ -377,7 +377,7 @@ class Crypt_Blowfish for ($i = 0; $i < 18; $i++) { $data = 0; for ($j = 4; $j > 0; $j--) { - $data = $data << 8 | ord($key{$k}); + $data = $data << 8 | ord($key[$k]); $k = ($k + 1) % $len; } $this->_P[$i] ^= $data; diff --git a/classes/ConfigurationTest.php b/classes/ConfigurationTest.php index 6981c6c76..65b949962 100644 --- a/classes/ConfigurationTest.php +++ b/classes/ConfigurationTest.php @@ -180,7 +180,7 @@ class ConfigurationTestCore public static function test_magicquotes() { - return !get_magic_quotes_gpc(); + return function_exists('get_magic_quotes_gpc') ? !get_magic_quotes_gpc() : true; } public static function test_upload() diff --git a/classes/Tools.php b/classes/Tools.php index 22ddaf612..9b0eb1c16 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -104,65 +104,7 @@ class ToolsCore } } - if (function_exists('mcrypt_create_iv')) { - $bytes = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM); - - if ($bytes !== false && strlen($bytes) === $length) { - return $bytes; - } - } - - // Else try to get $length bytes of entropy. - // Thanks to Zend - - $result = ''; - $entropy = ''; - $msec_per_round = 400; - $bits_per_round = 2; - $total = $length; - $hash_length = 20; - - while (strlen($result) < $length) { - $bytes = ($total > $hash_length) ? $hash_length : $total; - $total -= $bytes; - - for ($i=1; $i < 3; $i++) { - $t1 = microtime(true); - $seed = mt_rand(); - - for ($j=1; $j < 50; $j++) { - $seed = sha1($seed); - } - - $t2 = microtime(true); - $entropy .= $t1 . $t2; - } - - $div = (int) (($t2 - $t1) * 1000000); - - if ($div <= 0) { - $div = 400; - } - - $rounds = (int) ($msec_per_round * 50 / $div); - $iter = $bytes * (int) (ceil(8 / $bits_per_round)); - - for ($i = 0; $i < $iter; $i ++) { - $t1 = microtime(); - $seed = sha1(mt_rand()); - - for ($j = 0; $j < $rounds; $j++) { - $seed = sha1($seed); - } - - $t2 = microtime(); - $entropy .= $t1 . $t2; - } - - $result .= sha1($entropy, true); - } - - return substr($result, 0, $length); + return false; } public static function strReplaceFirst($search, $replace, $subject, $cur = 0) @@ -1822,10 +1764,10 @@ class ToolsCore return Tools::strtoupper(Tools::substr($str, 0, 1)).Tools::substr($str, 1); } - public static function ucwords($str) + public static function ucwords($str, $encoding = 'utf-8') { if (function_exists('mb_convert_case')) { - return mb_convert_case($str, MB_CASE_TITLE); + return mb_convert_case($str, MB_CASE_TITLE, $encoding); } return ucwords(Tools::strtolower($str)); } diff --git a/config/defines.inc.php b/config/defines.inc.php index 44ec5711d..899b1a0a8 100644 --- a/config/defines.inc.php +++ b/config/defines.inc.php @@ -140,7 +140,7 @@ define('_PS_TMP_IMG_DIR_', _PS_IMG_DIR_.'tmp/'); define('_PS_TRANS_PATTERN_', '(.*[^\\\\])'); define('_PS_MIN_TIME_GENERATE_PASSWD_', '360'); if (!defined('_PS_MAGIC_QUOTES_GPC_')) { - define('_PS_MAGIC_QUOTES_GPC_', get_magic_quotes_gpc()); + define('_PS_MAGIC_QUOTES_GPC_', function_exists('get_magic_quotes_gpc')? @get_magic_quotes_gpc() : false); } define('_CAN_LOAD_FILES_', 1); diff --git a/controllers/admin/AdminShopController.php b/controllers/admin/AdminShopController.php index a8624c117..c6cc943b3 100644 --- a/controllers/admin/AdminShopController.php +++ b/controllers/admin/AdminShopController.php @@ -36,7 +36,7 @@ class AdminShopControllerCore extends AdminController $this->table = 'shop'; $this->className = 'Shop'; $this->multishop_context = Shop::CONTEXT_ALL; - + $this->id_shop_group = (int)Tools::getValue('id_shop_group'); /* if $_GET['id_shop'] is transmitted, virtual url can be loaded in config.php, so we wether transmit shop_id in herfs */ @@ -250,7 +250,7 @@ class AdminShopControllerCore extends AdminController elseif (Shop::getTotalShops() == 1) $this->errors[] = Tools::displayError('You cannot disable the last shop.'); }*/ - + if (Tools::isSubmit('submitAddshopAndStay') || Tools::isSubmit('submitAddshop')) { $shop_group = new ShopGroup((int)Tools::getValue('id_shop_group')); if ($shop_group->shopNameExists(Tools::getValue('name'), (int)Tools::getValue('id_shop'))) { @@ -475,7 +475,7 @@ class AdminShopControllerCore extends AdminController $root_category = new Category($root_categories[0]['id_category']); $children = $root_category->getAllChildren($this->context->language->id); $selected_cat[] = $root_categories[0]['id_category']; - + foreach ($children as $child) { $selected_cat[] = $child->id; } @@ -576,7 +576,7 @@ class AdminShopControllerCore extends AdminController 'zone' => $this->l('Zones'), 'cart_rule' => $this->l('Cart rules'), ); - + // Hook for duplication of shop data $modules_list = Hook::getHookModuleExecList('actionShopDataDuplication'); if (is_array($modules_list) && count($modules_list) > 0) { @@ -586,7 +586,7 @@ class AdminShopControllerCore extends AdminController } asort($import_data); - + if (!$this->object->id) { $this->fields_import_form = array( 'radio' => array( @@ -615,9 +615,9 @@ class AdminShopControllerCore extends AdminController $this->fields_value = array( 'id_shop_group' => (Tools::getValue('id_shop_group') ? Tools::getValue('id_shop_group') : - (isset($obj->id_shop_group)) ? $obj->id_shop_group : Shop::getContextShopGroupID()), + ((isset($obj->id_shop_group)) ? $obj->id_shop_group : Shop::getContextShopGroupID())), 'id_category' => (Tools::getValue('id_category') ? Tools::getValue('id_category') : - (isset($obj->id_category)) ? $obj->id_category : (int)Configuration::get('PS_HOME_CATEGORY')), + ((isset($obj->id_category)) ? $obj->id_category : (int)Configuration::get('PS_HOME_CATEGORY'))), 'id_theme_checked' => (isset($obj->id_theme) ? $obj->id_theme : $id_theme) ); @@ -653,7 +653,7 @@ class AdminShopControllerCore extends AdminController if (Tools::isSubmit('id_category_default')) { $_POST['id_category'] = (int)Tools::getValue('id_category_default'); } - + /* Checking fields validity */ $this->validateRules(); @@ -711,13 +711,13 @@ class AdminShopControllerCore extends AdminController if (!array_key_exists('Edit', self::$cache_lang)) { self::$cache_lang['Edit'] = $this->l('Edit', 'Helper'); } - + $tpl->assign(array( 'href' => $this->context->link->getAdminLink('AdminShop').'&shop_id='.(int)$id.'&update'.$this->table, 'action' => self::$cache_lang['Edit'], 'id' => $id )); - + return $tpl->fetch(); } else { return; @@ -738,7 +738,7 @@ class AdminShopControllerCore extends AdminController $root_category = new Category($root_categories[0]['id_category']); $children = $root_category->getAllChildren($this->context->language->id); $selected_cat[] = $root_categories[0]['id_category']; - + foreach ($children as $child) { $selected_cat[] = $child->id; } diff --git a/controllers/admin/AdminTranslationsController.php b/controllers/admin/AdminTranslationsController.php index 87a586dcb..8c9d860a4 100644 --- a/controllers/admin/AdminTranslationsController.php +++ b/controllers/admin/AdminTranslationsController.php @@ -1019,7 +1019,7 @@ class AdminTranslationsControllerCore extends AdminController $arr_good_ext = array('.tpl', '.php'); foreach ($files as $key => $file) { - if ($file{0} === '.' || in_array(substr($file, 0, strrpos($file, '.')), $this->all_iso_lang)) { + if ($file[0] === '.' || in_array(substr($file, 0, strrpos($file, '.')), $this->all_iso_lang)) { unset($files[$key]); } elseif ($type_clear === 'file' && !in_array(substr($file, strrpos($file, '.')), $arr_good_ext)) { unset($files[$key]); @@ -2872,7 +2872,7 @@ class AdminTranslationsControllerCore extends AdminController $initial_root_dir = $root_dir; foreach ($modules as $module) { $root_dir = $initial_root_dir; - if ($module{0} == '.') { + if ($module[0] == '.') { continue; } From 7129289cd51ac334488453e77c5f5fa605d5dfbf Mon Sep 17 00:00:00 2001 From: shreesh arora Date: Sat, 1 May 2021 15:17:08 +0530 Subject: [PATCH 3/7] removed curly brace syntax for accessing array index in cookie.php --- classes/Cookie.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/Cookie.php b/classes/Cookie.php index 6747b0c24..89ee0ef6e 100644 --- a/classes/Cookie.php +++ b/classes/Cookie.php @@ -66,7 +66,7 @@ class CookieCore $this->_standalone = $standalone; $this->_expire = is_null($expire) ? time() + 1728000 : (int)$expire; $this->_path = trim(($this->_standalone ? '' : Context::getContext()->shop->physical_uri).$path, '/\\').'/'; - if ($this->_path{0} != '/') { + if ($this->_path[0] != '/') { $this->_path = '/'.$this->_path; } $this->_path = rawurlencode($this->_path); From ad352ae354176d8aee3e8a83a496b46020ae5015 Mon Sep 17 00:00:00 2001 From: shreesh arora Date: Sat, 1 May 2021 22:23:50 +0530 Subject: [PATCH 4/7] update getm_magic_quotes function checks --- install/upgrade/classes/AddConfToFile.php | 2 +- install/upgrade/php/latin1_database_to_utf8.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install/upgrade/classes/AddConfToFile.php b/install/upgrade/classes/AddConfToFile.php index f2525b4d0..d88678740 100644 --- a/install/upgrade/classes/AddConfToFile.php +++ b/install/upgrade/classes/AddConfToFile.php @@ -86,7 +86,7 @@ class AddConfToFile public function checkString($string) { - if (get_magic_quotes_gpc()) { + if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) { $string = stripslashes($string); } if (!is_numeric($string)) { diff --git a/install/upgrade/php/latin1_database_to_utf8.php b/install/upgrade/php/latin1_database_to_utf8.php index a0fbcc7e5..4b7e6a8bc 100644 --- a/install/upgrade/php/latin1_database_to_utf8.php +++ b/install/upgrade/php/latin1_database_to_utf8.php @@ -25,7 +25,7 @@ */ if (!defined('_PS_MAGIC_QUOTES_GPC_')) { - define('_PS_MAGIC_QUOTES_GPC_', get_magic_quotes_gpc()); + define('_PS_MAGIC_QUOTES_GPC_', function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()); } if (!defined('_PS_MYSQL_REAL_ESCAPE_STRING_')) { define('_PS_MYSQL_REAL_ESCAPE_STRING_', function_exists('mysql_real_escape_string')); From 99d1dfd172d05e9cafeeffde1d7467f021a9bf9a Mon Sep 17 00:00:00 2001 From: shreesh arora Date: Wed, 19 May 2021 12:21:46 +0530 Subject: [PATCH 5/7] resolve index not defined error in order restrict date --- .../classes/HotelOrderRestrictDate.php | 6 ++---- modules/sekeywords/sekeywords.php | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/hotelreservationsystem/classes/HotelOrderRestrictDate.php b/modules/hotelreservationsystem/classes/HotelOrderRestrictDate.php index a51eb1b82..3d490af2c 100644 --- a/modules/hotelreservationsystem/classes/HotelOrderRestrictDate.php +++ b/modules/hotelreservationsystem/classes/HotelOrderRestrictDate.php @@ -54,10 +54,8 @@ class HotelOrderRestrictDate extends ObjectModel $obj_ord_rest = new self(); $order_restrict_data = $obj_ord_rest->getDataByHotelId($id_hotel); - $max_order_date_restr = $order_restrict_data['max_order_date']; - - if (isset($max_order_date_restr) && $max_order_date_restr) { - $max_order_date = $max_order_date_restr; + if (isset($order_restrict_data['max_order_date']) && $order_restrict_data['max_order_date']) { + $max_order_date = $order_restrict_data['max_order_date']; } elseif (isset($global_max_order_date) && $global_max_order_date) { $max_order_date = $global_max_order_date; } else { diff --git a/modules/sekeywords/sekeywords.php b/modules/sekeywords/sekeywords.php index 0e7cd850a..b259a3961 100644 --- a/modules/sekeywords/sekeywords.php +++ b/modules/sekeywords/sekeywords.php @@ -89,7 +89,7 @@ class SEKeywords extends ModuleGraph public function hookTop($params) { - if (!isset($_SERVER['HTTP_REFERER']) || strpos($_SERVER['HTTP_REFERER'], Tools::getHttpHost(false, false) == 0)) { + if (!isset($_SERVER['HTTP_REFERER']) || strpos($_SERVER['HTTP_REFERER'], Tools::getHttpHost(false, false)) == 0) { return; } From c2c386fa7a8b602f81ca0b9bfa88fd4a5c556519 Mon Sep 17 00:00:00 2001 From: shreesh arora Date: Wed, 19 May 2021 13:08:17 +0530 Subject: [PATCH 6/7] Resolve cart and account logout issue --- classes/Cart.php | 3 +++ classes/Connection.php | 2 +- controllers/admin/AdminProductsController.php | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/classes/Cart.php b/classes/Cart.php index 7d380889b..6636635eb 100644 --- a/classes/Cart.php +++ b/classes/Cart.php @@ -2632,6 +2632,9 @@ class CartCore extends ObjectModel */ public static function desintifier($int, $delimiter = ',') { + if (!$int) + return; + $delimiter_len = $int[0]; $int = strrev(substr($int, 1)); $elm = explode(str_repeat('0', $delimiter_len + 1), $int); diff --git a/classes/Connection.php b/classes/Connection.php index d44729a10..c14ee13fe 100644 --- a/classes/Connection.php +++ b/classes/Connection.php @@ -136,7 +136,7 @@ class ConnectionCore extends ObjectModel '.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).' ORDER BY `date_add` DESC'; $result = Db::getInstance()->getRow($sql, false); - if (!$result['id_guest'] && (int)$cookie->id_guest) { + if (!isset($result['id_guest']) && (int)$cookie->id_guest) { // The old connections details are removed from the database in order to spare some memory Connection::cleanConnectionsPages(); diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 35879aea7..f5070a75b 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -2925,7 +2925,9 @@ class AdminProductsControllerCore extends AdminController public function renderForm() { // This nice code (irony) is here to store the product name, because the row after will erase product name in multishop context - $this->product_name = $this->object->name[$this->context->language->id]; + if (Validate::isLoadedObject(($this->object))) { + $this->product_name = $this->object->name[$this->context->language->id]; + } if (!method_exists($this, 'initForm'.$this->tab_display)) { return; From 0d1cf1e87e815878afdfe259141b43df0d8113e2 Mon Sep 17 00:00:00 2001 From: shreesh arora Date: Wed, 19 May 2021 13:28:10 +0530 Subject: [PATCH 7/7] Changes in paypal module --- modules/paypal/api/sdk/braintree/lib/Braintree/Digest.php | 4 ++-- modules/paypal/api/sdk/braintree/lib/Braintree/Util.php | 2 +- modules/paypal/paypal.php | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/paypal/api/sdk/braintree/lib/Braintree/Digest.php b/modules/paypal/api/sdk/braintree/lib/Braintree/Digest.php index ec6d9e090..c859c61b2 100644 --- a/modules/paypal/api/sdk/braintree/lib/Braintree/Digest.php +++ b/modules/paypal/api/sdk/braintree/lib/Braintree/Digest.php @@ -52,8 +52,8 @@ class Digest $outerPad = str_repeat(chr(0x5C), 64); for ($i = 0; $i < 20; $i++) { - $innerPad{$i} = $keyDigest{$i} ^ $innerPad{$i}; - $outerPad{$i} = $keyDigest{$i} ^ $outerPad{$i}; + $innerPad[$i] = $keyDigest[$i] ^ $innerPad[$i]; + $outerPad[$i] = $keyDigest[$i] ^ $outerPad[$i]; } return sha1($outerPad.pack($pack, sha1($innerPad.$message))); diff --git a/modules/paypal/api/sdk/braintree/lib/Braintree/Util.php b/modules/paypal/api/sdk/braintree/lib/Braintree/Util.php index 23d4af6bf..0a7757ce5 100644 --- a/modules/paypal/api/sdk/braintree/lib/Braintree/Util.php +++ b/modules/paypal/api/sdk/braintree/lib/Braintree/Util.php @@ -202,7 +202,7 @@ class Util // every time this function is called. static $callback = null; if ($callback === null) { - $callback = create_function('$matches', 'return strtoupper($matches[1]);'); + $callback = function ($matches) { return strtoupper($matches[1]); }; } return preg_replace_callback('/' . $delimiter . '(\w)/', $callback, $string); diff --git a/modules/paypal/paypal.php b/modules/paypal/paypal.php index 67f1c3c06..ff05f78db 100644 --- a/modules/paypal/paypal.php +++ b/modules/paypal/paypal.php @@ -2550,9 +2550,9 @@ class PayPal extends PaymentModule // check digit-by-digit, if they have a difference, return 1 or -1 (greater/lower than) for ($i = 0; $i < Tools::strlen($num1); $i++) { - if ((int) $num1{$i} > (int) $num2{$i}) { + if ((int) $num1[$i] > (int) $num2[$i]) { return 1; - } elseif ((int) $num1{$i} < (int) $num2{$i}) { + } elseif ((int) $num1[$i] < (int) $num2[$i]) { return -1; } @@ -2575,7 +2575,7 @@ class PayPal extends PaymentModule 'address_billing' => new Address($this->context->cart->id_address_invoice), 'cart' => $this->context->cart, 'patternRules' => array('avoid' => array()), - 'cart_image_size' => version_compare(_PS_VERSION_, '1.5', '<') ? 'small' : version_compare(_PS_VERSION_, '1.6', '<') ? 'small_default' : 'cart_default', + 'cart_image_size' => version_compare(_PS_VERSION_, '1.5', '<') ? 'small' : (version_compare(_PS_VERSION_, '1.6', '<') ? 'small_default' : 'cart_default'), 'useStyle14' => version_compare(_PS_VERSION_, '1.5', '<'), 'useStyle15' => version_compare(_PS_VERSION_, '1.5', '>') && version_compare(_PS_VERSION_, '1.6', '<'), ));