// Merge -> revision 9124
This commit is contained in:
@@ -63,7 +63,7 @@ class MRManagement extends MondialRelay
|
||||
SET `id_method` = '.(int)$this->_params['id_mr_method'].', ';
|
||||
if (is_array($this->_params['relayPointInfo']))
|
||||
foreach($this->_params['relayPointInfo'] as $nameKey => $value)
|
||||
$query .= '`MR_Selected_'.pSQL($nameKey).'` = "'.pSQL($value).'", ';
|
||||
$query .= '`MR_Selected_'.MRTools::bqSQL($nameKey).'` = "'.pSQL($value).'", ';
|
||||
else // Clean the existing relay point data
|
||||
$query .= '
|
||||
MR_Selected_Num = NULL,
|
||||
@@ -82,11 +82,11 @@ class MRManagement extends MondialRelay
|
||||
(`id_customer`, `id_method`, `id_cart`, ';
|
||||
if (is_array($this->_params['relayPointInfo']))
|
||||
foreach($this->_params['relayPointInfo'] as $nameKey => $value)
|
||||
$query .= '`MR_Selected_'.pSQL($nameKey).'`, ';
|
||||
$query .= '`MR_Selected_'.MRTools::bqSQL($nameKey).'`, ';
|
||||
$query = rtrim($query, ', ').') VALUES (
|
||||
'.$this->_params['id_customer'].',
|
||||
'.$this->_params['id_mr_method'].',
|
||||
'.$this->_params['id_cart'].', ';
|
||||
'.(int)$this->_params['id_customer'].',
|
||||
'.(int)$this->_params['id_mr_method'].',
|
||||
'.(int)$this->_params['id_cart'].', ';
|
||||
if (is_array($this->_params['relayPointInfo']))
|
||||
foreach($this->_params['relayPointInfo'] as $nameKey => $value)
|
||||
$query .= '"'.pSQL($value).'", ';
|
||||
|
||||
@@ -30,6 +30,9 @@
|
||||
*/
|
||||
class MRTools
|
||||
{
|
||||
/*
|
||||
** Replace all accented chars to normal
|
||||
*/
|
||||
static public function replaceAccentedCharacters($string)
|
||||
{
|
||||
if (function_exists('iconv'))
|
||||
@@ -46,6 +49,17 @@ class MRTools
|
||||
return $cleanedString;
|
||||
}
|
||||
|
||||
/*
|
||||
** Fix security and compatibility for PS < 1.4.5
|
||||
*/
|
||||
static function bqSQL($string)
|
||||
{
|
||||
return str_replace('`', '\`', pSQL($string));
|
||||
}
|
||||
|
||||
/*
|
||||
** Check zip code by country
|
||||
*/
|
||||
static public function checkZipcodeByCountry($zipcode, $params)
|
||||
{
|
||||
$id_country = $params['id_country'];
|
||||
|
||||
Reference in New Issue
Block a user