From a12cf285cd3c72c6faf572ca208c5891bb2f1631 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 7 Aug 2015 17:37:05 +0300 Subject: [ci skip] Partial patch for #2284 The issue description is about update_string(), which I'm not sure if can be fixed at all. This patch only addresses protect_identifiers(). --- system/database/DB_driver.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'system/database/DB_driver.php') diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 659664db9..34d3a5979 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -1788,12 +1788,15 @@ abstract class CI_DB_driver { // with an alias. While we're at it, we will escape the components if (strpos($item, '.') !== FALSE) { - $parts = explode('.', $item); + $parts = explode('.', $item); // Does the first segment of the exploded item match // one of the aliases previously identified? If so, // we have nothing more to do other than escape the item - if (in_array($parts[0], $this->qb_aliased_tables)) + // + // NOTE: The ! empty() condition prevents this method + // from breaking when QB isn't enabled. + if ( ! empty($this->qb_aliased_tables) && in_array($parts[0], $this->qb_aliased_tables)) { if ($protect_identifiers === TRUE) { -- cgit v1.2.3-24-g4f1b