From a9e233b2092675f3066e88e6e4ce208fd64ce496 Mon Sep 17 00:00:00 2001 From: ChristopheBoucaut Date: Thu, 25 Jul 2013 15:46:08 +0200 Subject: [PATCH] Update Cart.php If magic_quotes_gpc is enabled, there is no need to escape the characters from $ _POST as they already are. --- classes/Cart.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/classes/Cart.php b/classes/Cart.php index ecbf3bad3..337d55e1a 100644 --- a/classes/Cart.php +++ b/classes/Cart.php @@ -3030,8 +3030,10 @@ class CartCore extends ObjectModel public function addTextFieldToProduct($id_product, $index, $type, $text_value) { $text_value = str_replace(array("\n", "\r"), '', nl2br($text_value)); - $text_value = str_replace('\\', '\\\\', $text_value); - $text_value = str_replace('\'', '\\\'', $text_value); + if (!_PS_MAGIC_QUOTES_GPC_){ + $text_value = str_replace('\\', '\\\\', $text_value); + $text_value = str_replace('\'', '\\\'', $text_value); + } return $this->_addCustomization($id_product, 0, $index, $type, $text_value, 0); }