diff --git a/classes/Address.php b/classes/Address.php index b6b69905b..5e11c50c1 100644 --- a/classes/Address.php +++ b/classes/Address.php @@ -543,14 +543,14 @@ class AddressCore extends ObjectModel LEFT JOIN `'._DB_PREFIX_.'state` s ON s.`id_country` = cl.`id_country` AND s.`id_state` = a.`id_state` WHERE id_customer > 0 AND a.`deleted` = 0 AND - (a.`address1` LIKE \'%'.$query.'%\' OR - a.`postcode` LIKE \'%'.$query.'%\' OR - a.`city` LIKE \'%'.$query.'%\' OR - a.`phone` LIKE \'%'.$query.'%\' OR - a.`company` LIKE \'%'.$query.'%\' OR - a.`alias` LIKE \'%'.$query.'%\' OR - s.`name` LIKE \'%'.$query.'%\' OR - cl.`name` LIKE \'%'.$query.'%\' + (a.`address1` LIKE \'%'.pSQL($query).'%\' OR + a.`postcode` LIKE \'%'.pSQL($query).'%\' OR + a.`city` LIKE \'%'.pSQL($query).'%\' OR + a.`phone` LIKE \'%'.pSQL($query).'%\' OR + a.`company` LIKE \'%'.pSQL($query).'%\' OR + a.`alias` LIKE \'%'.pSQL($query).'%\' OR + s.`name` LIKE \'%'.pSQL($query).'%\' OR + cl.`name` LIKE \'%'.pSQL($query).'%\' ) '); } diff --git a/classes/CustomerMessage.php b/classes/CustomerMessage.php index 21798c993..db0dddded 100644 --- a/classes/CustomerMessage.php +++ b/classes/CustomerMessage.php @@ -146,7 +146,7 @@ class CustomerMessageCore extends ObjectModel ON (ct.`id_customer_thread` = cm.`id_customer_thread`) LEFT JOIN '._DB_PREFIX_.'customer c ON (IFNULL(ct.`id_customer`, ct.`email`) = IFNULL(c.`id_customer`, c.`email`)) - WHERE `message` LIKE \'%'.$query.'%\' + WHERE `message` LIKE \'%'.pSQL($query).'%\' '); } diff --git a/modules/hotelreservationsystem/classes/HotelBranchRefundRules.php b/modules/hotelreservationsystem/classes/HotelBranchRefundRules.php index ede3ec95c..865c745eb 100644 --- a/modules/hotelreservationsystem/classes/HotelBranchRefundRules.php +++ b/modules/hotelreservationsystem/classes/HotelBranchRefundRules.php @@ -87,7 +87,7 @@ class HotelBranchRefundRules extends ObjectModel $condition .= ' AND `id_refund_rule` = '.(int)$idRefundRule; } if ($notInVals) { - $condition .= ' AND `id_refund_rule` NOT IN ('.implode(',', $notInVals).')'; + $condition .= ' AND `id_refund_rule` NOT IN ('.implode(',', array_map('intval', $notInVals)).')'; } return Db::getInstance()->delete( 'htl_branch_refund_rules', diff --git a/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php b/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php index dd4f7da37..85c84ea1a 100644 --- a/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php +++ b/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php @@ -149,7 +149,7 @@ class HotelRoomTypeFeaturePricing extends ObjectModel LEFT JOIN `'._DB_PREFIX_.'htl_room_type_feature_pricing` rtfp ON (rtfpr.`id_feature_price` = rtfp.`id_feature_price` AND rtfp.`id_product`='.(int) $idRoomType.') LEFT JOIN `'._DB_PREFIX_.'htl_room_type_feature_pricing_group` rtfpg - ON (rtfp.`id_feature_price` = rtfpg.`id_feature_price` '.($groups ? ' AND rtfpg.`id_group` IN ('.pSQL(implode(', ',$groups)).')' : ' ' ).') + ON (rtfp.`id_feature_price` = rtfpg.`id_feature_price` '.($groups ? ' AND rtfpg.`id_group` IN ('.implode(', ', array_map('intval', $groups)).')' : ' ' ).') WHERE 1 '.( !is_null($active) ? ' AND rtfp.`active`= '.(int) $active: ' ').' ' .(!is_null($skipFeaturePriceId) ? ' AND rtfpr.`id_feature_price`!='.(int) $skipFeaturePriceId : ' '); $sqlWhere = ''; if ($restrictions && is_array($restrictions)) { diff --git a/modules/hotelreservationsystem/classes/HotelRoomTypeGlobalDemandAdvanceOption.php b/modules/hotelreservationsystem/classes/HotelRoomTypeGlobalDemandAdvanceOption.php index 145fad433..cb3e88040 100644 --- a/modules/hotelreservationsystem/classes/HotelRoomTypeGlobalDemandAdvanceOption.php +++ b/modules/hotelreservationsystem/classes/HotelRoomTypeGlobalDemandAdvanceOption.php @@ -113,7 +113,7 @@ class HotelRoomTypeGlobalDemandAdvanceOption extends ObjectModel $sql = 'SELECT * FROM `'._DB_PREFIX_.'htl_room_type_global_demand_advance_option` WHERE `id_global_demand` = '.(int)$idGlobalDemand; if (count($skipIds)) { - $sql .= ' AND `id_option` NOT IN ('.pSQL(implode(',', $skipIds)).')' ; + $sql .= ' AND `id_option` NOT IN ('.implode(',', array_map('intval', $skipIds)).')' ; } if ($advOptions = Db::getInstance()->executeS($sql)) { foreach ($advOptions as &$option) {