1
0
mirror of https://github.com/dg/dibi.git synced 2025-10-21 01:36:26 +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

@@ -281,9 +281,11 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver
{
switch ($type) {
case dibi::FIELD_TEXT:
case dibi::FIELD_BINARY:
return "'" . mysql_real_escape_string($value, $this->connection) . "'";
case dibi::FIELD_BINARY:
return "_binary'" . mysql_real_escape_string($value, $this->connection) . "'";
case dibi::IDENTIFIER:
// @see http://dev.mysql.com/doc/refman/5.0/en/identifiers.html
$value = str_replace('`', '``', $value);