mirror of
https://github.com/dg/dibi.git
synced 2025-08-16 02:54:25 +02:00
quoted identifiers security fix
This commit is contained in:
@@ -242,6 +242,7 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver
|
||||
case dibi::IDENTIFIER:
|
||||
switch ($this->connection->getAttribute(PDO::ATTR_DRIVER_NAME)) {
|
||||
case 'mysql':
|
||||
$value = str_replace('`', '``', $value);
|
||||
return '`' . str_replace('.', '`.`', $value) . '`';
|
||||
|
||||
case 'pgsql':
|
||||
@@ -254,9 +255,11 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver
|
||||
|
||||
case 'sqlite':
|
||||
case 'sqlite2':
|
||||
$value = strtr($value, '[]', ' ');
|
||||
case 'odbc':
|
||||
case 'oci': // TODO: not tested
|
||||
case 'mssql':
|
||||
$value = str_replace(array('[', ']'), array('[[', ']]'), $value);
|
||||
return '[' . str_replace('.', '].[', $value) . ']';
|
||||
|
||||
default:
|
||||
|
Reference in New Issue
Block a user