From be178a79382cae5079622396f8f9679a15e0f58b Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 20 Aug 2015 13:23:21 +0300 Subject: Fix #4065 --- system/database/DB_driver.php | 2 +- user_guide_src/source/changelog.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 34d3a5979..9c4d7e007 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -1760,7 +1760,7 @@ abstract class CI_DB_driver { } // Convert tabs or multiple spaces into single spaces - $item = preg_replace('/\s+/', ' ', $item); + $item = preg_replace('/\s+/', ' ', trim($item)); // If the item has an alias declaration we remove it and set it aside. // Note: strripos() is used in order to support spaces in table names diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index a0a54c34b..b355d8d9e 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -19,6 +19,7 @@ Bug fixes for 3.0.2 - Fixed a bug (#4052) - :doc:`Routing ` with anonymous functions didn't work for routes that don't use regular expressions. - Fixed a bug (#4056) - :doc:`Input Library ` method ``get_request_header()`` could not return a value unless ``request_headers()`` was called beforehand. - Fixed a bug where the :doc:`Database Class ` entered an endless loop if it fails to connect with the 'sqlsrv' driver. +- Fixed a bug (#4065) - :doc:`Database ` method ``protect_identifiers()`` treats a traling space as an alias separator if the input doesn't contain ' AS '. Version 3.0.1 ============= -- cgit v1.2.3-24-g4f1b