Skip to content

Commit 5220e67

Browse files
Merge pull request #45 from Feloot/patch-1
Escape some SQL query
2 parents a56f997 + 022d581 commit 5220e67

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ps_googleanalytics.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ protected function _manageData($data, $action)
767767
return json_decode($dataretour,true);
768768
}
769769
if ($action == 'W') {
770-
return Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'ganalytics_data` (id_cart, id_shop, data) VALUES(\''.(int)$this->context->cart->id.'\',\''.(int)$this->context->shop->id.'\',\''.json_encode($data).'\') ON DUPLICATE KEY UPDATE data =\''.json_encode($data).'\' ;');
770+
return Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'ganalytics_data` (id_cart, id_shop, data) VALUES(\''.(int)$this->context->cart->id.'\',\''.(int)$this->context->shop->id.'\',\''.pSQL(json_encode($data)).'\') ON DUPLICATE KEY UPDATE data =\''.pSQL(json_encode($data)).'\' ;');
771771
}
772772
if ($action == 'A') {
773773
$dataretour = Db::getInstance()->getValue('SELECT data FROM `'._DB_PREFIX_.'ganalytics_data` WHERE id_cart = \''.(int)$this->context->cart->id.'\' AND id_shop = \''.(int)$this->context->shop->id.'\'');

0 commit comments

Comments
 (0)