1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-09 15:47:23 +02:00

- improved binary escaping

This commit is contained in:
David Grudl
2009-03-16 05:47:20 +00:00
parent 97969edace
commit a9afe1e397
4 changed files with 17 additions and 3 deletions

View File

@@ -265,9 +265,11 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver
{
switch ($type) {
case dibi::FIELD_TEXT:
case dibi::FIELD_BINARY:
return "'" . mysqli_real_escape_string($this->connection, $value) . "'";
case dibi::FIELD_BINARY:
return "_binary'" . mysqli_real_escape_string($this->connection, $value) . "'";
case dibi::IDENTIFIER:
$value = str_replace('`', '``', $value);
return '`' . str_replace('.', '`.`', $value) . '`';