Update Cart.php

If magic_quotes_gpc is enabled, there is no need to escape the characters from $ _POST as they already are.
This commit is contained in:
ChristopheBoucaut
2013-07-25 15:46:08 +02:00
parent a54ac39632
commit a9e233b209
+4 -2
View File
@@ -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);
}