1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-05 05:37:39 +02:00

DibiMsSql2005Driver: fixed identifier escaping

Annoted link to MS SQL doc does not talk about open bracket '[' escaping, only closing bracket ']'.

dibi::query('CREATE TABLE %n (id INT)', 'abc[]def');
 - old: creates table 'abc[[]def'
 - new: creates table 'abc[]def'
This commit is contained in:
Miloslav Hůla
2013-04-10 12:06:27 +02:00
parent 4ea885f2b9
commit 0ebe7ad84f

View File

@@ -243,7 +243,7 @@ class DibiMsSql2005Driver extends DibiObject implements IDibiDriver, IDibiResult
case dibi::IDENTIFIER:
// @see http://msdn.microsoft.com/en-us/library/ms176027.aspx
return '[' . str_replace(array('[', ']'), array('[[', ']]'), $value) . ']';
return '[' . str_replace(']', ']]', $value) . ']';
case dibi::BOOL:
return $value ? 1 : 0;