Readd real_escape method for addI18nCondition

modifié:         core/lib/Thelia/ImportExport/Export/ExportHandler.php
This commit is contained in:
Benjamin Perche
2014-07-29 09:36:03 +02:00
parent 0d37e3470b
commit bf9ffedefd

View File

@@ -150,6 +150,33 @@ abstract class ExportHandler extends AbstractHandler
; ;
} }
/**
* @param $str
* @return string
*
* Really escapes a string for SQL request.
*/
protected function real_escape($str)
{
$str = trim($str, "\"'");
$return = "CONCAT(";
$len = strlen($str);
for ($i = 0; $i < $len; ++$i) {
$return .= "CHAR(".ord($str[$i])."),";
}
if ($i > 0) {
$return = substr($return, 0, -1);
} else {
$return = "\"\"";
}
$return .= ")";
return $return;
}
public function renderLoop($type, array $args = array()) public function renderLoop($type, array $args = array())
{ {
$loopsDefinition = $this->container->getParameter("thelia.parser.loops"); $loopsDefinition = $this->container->getParameter("thelia.parser.loops");