diff options
author | Bharat Mediratta <bharat@menalto.com> | 2012-05-14 21:54:41 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2012-05-14 21:54:41 -0700 |
commit | 6a6b3f90f36293a40cba091c3ac387abb64f3c1a (patch) | |
tree | ce1330f55dca8e91db39ab889af1f5e626a53eaa /system/libraries/Database_Builder.php | |
parent | 9408074eb42e0d56a1626f4d08b1fdbd19e79fa4 (diff) |
Verify that where() clauses are well formed. Fixes #1865.
Diffstat (limited to 'system/libraries/Database_Builder.php')
-rw-r--r-- | system/libraries/Database_Builder.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/system/libraries/Database_Builder.php b/system/libraries/Database_Builder.php index e86ce379..553ffd98 100644 --- a/system/libraries/Database_Builder.php +++ b/system/libraries/Database_Builder.php @@ -190,6 +190,8 @@ class Database_Builder_Core { { foreach ($columns as $column) { + if (count($column) != 3) + throw new Database_Exception('Column triplets require a column, op and value'); $this->where[] = array('AND' => $column); } } @@ -216,6 +218,8 @@ class Database_Builder_Core { { foreach ($columns as $column) { + if (count($column) != 3) + throw new Database_Exception('Column triplets require a column, op and value'); $this->where[] = array('OR' => $column); } } @@ -422,6 +426,8 @@ class Database_Builder_Core { { foreach ($columns as $column) { + if (count($column) != 3) + throw new Database_Exception('Column triplets require a column, op and value'); $this->having[] = array('AND' => $column); } } @@ -447,6 +453,8 @@ class Database_Builder_Core { { foreach ($columns as $column) { + if (count($column) != 3) + throw new Database_Exception('Column triplets require a column, op and value'); $this->having[] = array('OR' => $column); } } |