mirror of
https://github.com/dg/dibi.git
synced 2025-08-06 06:07:39 +02:00
- improved binary escaping
This commit is contained in:
@@ -231,6 +231,16 @@ class DibiSqliteDriver extends DibiObject implements IDibiDriver
|
||||
case dibi::FIELD_BINARY:
|
||||
return "'" . sqlite_escape_string($value) . "'";
|
||||
|
||||
/*case dibi::FIELD_BINARY: // SQLite 3
|
||||
static $hex = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F');
|
||||
$value = (string) $value;
|
||||
$len = strlen($value);
|
||||
$res = "X'";
|
||||
for ($i = 0; $i < $len; $i++) {
|
||||
$res .= $hex[ord($value[$i]) >> 4] . $hex[ord($value[$i]) & 15];
|
||||
}
|
||||
return $res . "'";*/
|
||||
|
||||
case dibi::IDENTIFIER:
|
||||
return '[' . str_replace('.', '].[', strtr($value, '[]', ' ')) . ']';
|
||||
|
||||
|
Reference in New Issue
Block a user