From 20bdf1d7b0ee0c639f0d5d603677c199a20336ce Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 21 Mar 2012 20:56:08 -0400 Subject: [PATCH] Add escaping to table names. SQLite was not quoting table names, so tables with keywords caused errors. Fixes #2702 --- lib/Cake/Model/Datasource/Database/Sqlite.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Model/Datasource/Database/Sqlite.php b/lib/Cake/Model/Datasource/Database/Sqlite.php index 5c2c9f1d2..59db71dcf 100644 --- a/lib/Cake/Model/Datasource/Database/Sqlite.php +++ b/lib/Cake/Model/Datasource/Database/Sqlite.php @@ -166,7 +166,9 @@ class Sqlite extends DboSource { return $cache; } $fields = array(); - $result = $this->_execute('PRAGMA table_info(' . $table . ')'); + $result = $this->_execute( + 'PRAGMA table_info(' . $this->value($table, 'string') . ')' + ); foreach ($result as $column) { $column = (array)$column;