diff options
author | Andrey Andreev <narf@devilix.net> | 2016-10-28 11:50:03 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2016-10-28 11:50:03 +0200 |
commit | be4bab99fc8165858568e0278492aaebecee68f0 (patch) | |
tree | a8f9aca2c8221d801b6f0066a269ca2a3cfde9cc | |
parent | dbc025b6c2c9b0b085bb79dc126bc58fb2a8c2a8 (diff) |
Fix #4884
-rw-r--r-- | system/database/DB_query_builder.php | 2 | ||||
-rw-r--r-- | user_guide_src/source/changelog.rst | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php index 5491b2000..5a86ce50f 100644 --- a/system/database/DB_query_builder.php +++ b/system/database/DB_query_builder.php @@ -679,7 +679,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver { // value appears not to have been set, assign the test to IS NULL $k .= ' IS NULL'; } - elseif (preg_match('/\s*(!?=|<>|IS(?:\s+NOT)?)\s*$/i', $k, $match, PREG_OFFSET_CAPTURE)) + elseif (preg_match('/\s*(!?=|<>|\sIS(?:\s+NOT)?\s)\s*$/i', $k, $match, PREG_OFFSET_CAPTURE)) { $k = substr($k, 0, $match[0][1]).($match[1][0] === '=' ? ' IS NULL' : ' IS NOT NULL'); } diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 58ca20ee9..0a8160acb 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -20,6 +20,7 @@ Bug fixes for 3.1.2 - Fixed a regression (#4874) - :doc:`Session Library <libraries/sessions>` didn't take into account ``session.hash_bits_per_character`` when validating session IDs. - Fixed a bug (#4871) - :doc:`Query Builder <database/query_builder>` method ``update_batch()`` didn't properly handle identifier escaping. +- Fixed a bug (#4884) - :doc:`Query Builder <database/query_builder>` didn't properly parse field names ending in 'is' when used inside WHERE and HAVING statements. Version 3.1.1 ============= |