diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-06-15 11:30:02 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-06-15 11:30:02 +0200 |
commit | 974c75bc030b4eb0521b66bf85e81a5ab61d14a6 (patch) | |
tree | 99085961a432e9e4df5550d997dd97fc8d3b335b /system/database | |
parent | e10fb79a95e2b0594ae68560df8963f92fea86d7 (diff) |
Fix having()
Diffstat (limited to 'system/database')
-rw-r--r-- | system/database/DB_query_builder.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php index 4c70ccc78..486fda963 100644 --- a/system/database/DB_query_builder.php +++ b/system/database/DB_query_builder.php @@ -932,10 +932,9 @@ abstract class CI_DB_query_builder extends CI_DB_driver { { $prefix = (count($this->qb_having) === 0) ? '' : $type; - if ($escape === TRUE) - { - $k = $this->protect_identifiers($k); - } + $k = $this->_has_operator($k) + ? $this->protect_identifiers(substr($k, 0, strpos(rtrim($k), ' ')), FALSE, $escape).strchr(rtrim($k), ' ') + : $this->protect_identifiers($k, FALSE, $escape); if ( ! $this->_has_operator($k)) { |