From b55050962bb731d1a99430cd37953e55434236a9 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 13 Jun 2012 18:03:30 +0300 Subject: Revert from() alias escaping fix - it was breaking more stuff --- system/database/DB_driver.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'system') diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 858ec356d..c71a6aa3a 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -1267,12 +1267,10 @@ class CI_DB_driver { // If the item has an alias declaration we remove it and set it aside. // Basically we remove everything to the right of the first space - if (preg_match('/^([^\s]+) (AS )*(.+)$/i', $item, $matches)) + if (strpos($item, ' ') !== FALSE) { - $item = $matches[1]; - - // Escape the alias - $alias = ' '.$matches[2].$this->_escape_identifiers($matches[3]); + $alias = strstr(' ', $item); + $item = substr($item, 0, - strlen($alias)); } else { -- cgit v1.2.3-24-g4f1b From 9edcacd22ada577c88d82d911b2157e8f0f6a928 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 13 Jun 2012 21:59:33 +0300 Subject: Switch strstr() arguments --- system/database/DB_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system') diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index c71a6aa3a..dcaeb5a9b 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -1269,7 +1269,7 @@ class CI_DB_driver { // Basically we remove everything to the right of the first space if (strpos($item, ' ') !== FALSE) { - $alias = strstr(' ', $item); + $alias = strstr($item, ' '); $item = substr($item, 0, - strlen($alias)); } else -- cgit v1.2.3-24-g4f1b From ea6cbe026b73be13dd853d710b9609e3faf50f44 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 13 Jun 2012 23:37:04 +0300 Subject: Revert a preg_replace() --- system/database/DB_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system') diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index dcaeb5a9b..775fd3354 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -1263,7 +1263,7 @@ class CI_DB_driver { } // Convert tabs or multiple spaces into single spaces - $item = preg_replace('/\s+/', ' ', $item); + $item = preg_replace('/[\t ]+/', ' ', $item); // If the item has an alias declaration we remove it and set it aside. // Basically we remove everything to the right of the first space -- cgit v1.2.3-24-g4f1b