summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authorHamza Bhatti <tiyowan@gmail.com>2012-03-05 19:58:56 +0100
committerHamza Bhatti <tiyowan@gmail.com>2012-03-05 19:58:56 +0100
commitd3c1ccf1fa5f4a38cfc9b8f5e3eba8bb23c83cdd (patch)
treeb81b92eb8a68181fa6923d68ef4a9c6a94e7e66c /system/database
parent0046d08af0d395fa53e23304707a0df0f36361d5 (diff)
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 <tiyowan@gmail.com>
Diffstat (limited to 'system/database')
-rw-r--r--system/database/DB_active_rec.php2
1 files changed, 1 insertions, 1 deletions
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]);
}