summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2015-08-07 16:37:05 +0200
committerAndrey Andreev <narf@devilix.net>2015-08-07 16:37:05 +0200
commita12cf285cd3c72c6faf572ca208c5891bb2f1631 (patch)
tree77a88233581fb610d2d2aaa48325879e82acf1a6
parentde82e175cd333a503a43f53a00f19c2513573d97 (diff)
[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().
-rw-r--r--system/database/DB_driver.php7
-rw-r--r--user_guide_src/source/changelog.rst4
2 files changed, 9 insertions, 2 deletions
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)
{
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 7d8ef835c..4988157e9 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -7,6 +7,10 @@ Version 3.0.2
Release Date: Not Released
+Bug fixes for 3.0.2
+-------------------
+
+- Fixed a bug (#2284) - :doc:`Database <database/index>` method ``protect_identifiers()`` breaks when :doc:`Query Builder <database/query_builder>` isn't enabled.
Version 3.0.1
=============