From d3c1ccf1fa5f4a38cfc9b8f5e3eba8bb23c83cdd Mon Sep 17 00:00:00 2001 From: Hamza Bhatti Date: Mon, 5 Mar 2012 22:58:56 +0400 Subject: Fix issue #64 Modify regular expression to be able to handle SQL bracket delimiters for column names that contain special characters or SQL keywords. Signed-off-by: Hamza Bhatti --- system/database/DB_active_rec.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database') diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index eaae23f30..f648e5591 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -341,7 +341,7 @@ class CI_DB_active_record extends CI_DB_driver { $this->_track_aliases($table); // Strip apart the condition and protect the identifiers - if (preg_match('/([\w\.]+)([\W\s]+)(.+)/', $cond, $match)) + if (preg_match('/([\[\w\.]+)([\W\s]+)(.+)/', $cond, $match)) { $cond = $this->_protect_identifiers($match[1]).$match[2].$this->_protect_identifiers($match[3]); } -- cgit v1.2.3-24-g4f1b