Fix SQL escape method
modifié: core/lib/Thelia/ImportExport/Export/Type/ProductPricesExport.php
This commit is contained in:
@@ -141,15 +141,25 @@ class ProductPricesExport extends ExportHandler
|
|||||||
return $data->loadModelCriteria($query);
|
return $data->loadModelCriteria($query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $str
|
||||||
|
* @return string
|
||||||
|
*
|
||||||
|
* Really escapes a string for SQL request.
|
||||||
|
*/
|
||||||
protected function real_escape($str)
|
protected function real_escape($str)
|
||||||
{
|
{
|
||||||
$return = "CONCAT(";
|
$return = "CONCAT(";
|
||||||
$len = strlen($str);
|
$len = strlen($str);
|
||||||
|
|
||||||
for($i = 0; $i < $len; ++$i) {
|
for($i = 0; $i < $len; ++$i) {
|
||||||
$return .= "CHAR(".ord($str[$i])."),";
|
$return .= "CHAR(".ord($str[$i])."),";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($i > 0) {
|
if ($i > 0) {
|
||||||
$return = substr($return, 0, -1);
|
$return = substr($return, 0, -1);
|
||||||
|
} else {
|
||||||
|
$return = "\"\"";
|
||||||
}
|
}
|
||||||
$return .= ")";
|
$return .= ")";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user