From 0b508b887a623f1dfbeffa35623603744c68a95c Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Sun, 2 Dec 2012 23:15:46 +0100 Subject: [PATCH 1/4] Update version number to 2.2.4 --- lib/Cake/VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/VERSION.txt b/lib/Cake/VERSION.txt index 702a3d46a..03e2e3a48 100644 --- a/lib/Cake/VERSION.txt +++ b/lib/Cake/VERSION.txt @@ -17,4 +17,4 @@ // @license MIT License (http://www.opensource.org/licenses/mit-license.php) // +--------------------------------------------------------------------------------------------+ // //////////////////////////////////////////////////////////////////////////////////////////////////// -2.2.3 +2.2.4 From 002700071d70c47b580f56e09e82dfeba512531f Mon Sep 17 00:00:00 2001 From: mark_story Date: Sun, 2 Dec 2012 20:59:56 -0500 Subject: [PATCH 2/4] Fix incorrectly quoted fields when using the || operator. Fixes #3404 --- lib/Cake/Model/Datasource/DboSource.php | 6 +++++- lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Model/Datasource/DboSource.php b/lib/Cake/Model/Datasource/DboSource.php index 0923bf166..4354bee3a 100644 --- a/lib/Cake/Model/Datasource/DboSource.php +++ b/lib/Cake/Model/Datasource/DboSource.php @@ -2574,7 +2574,11 @@ class DboSource extends DataSource { $value = $this->value($value, $type); if (!$virtual && $key !== '?') { - $isKey = (strpos($key, '(') !== false || strpos($key, ')') !== false); + $isKey = ( + strpos($key, '(') !== false || + strpos($key, ')') !== false || + strpos($key, '|') !== false + ); $key = $isKey ? $this->_quoteFields($key) : $this->name($key); } diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php index 7ae749268..926fc2aa8 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php @@ -2207,6 +2207,12 @@ class MysqlTest extends CakeTestCase { $expected = " WHERE `HardCandy`.`name` LIKE 'to be or%' AND `Candy`.`name` LIKE '%not to be%'"; $this->assertEquals($expected, $result); + $result = $this->Dbo->conditions(array( + "Person.name || ' ' || Person.surname ILIKE" => '%mark%' + )); + $expected = " WHERE `Person`.`name` || ' ' || `Person`.`surname` ILIKE '%mark%'"; + $this->assertEquals($expected, $result); + $result = $this->Dbo->conditions(array('score BETWEEN ? AND ?' => array(90.1, 95.7))); $expected = " WHERE `score` BETWEEN 90.1 AND 95.7"; $this->assertEquals($expected, $result); From 06c3f01af6ccfdfa1f8fc7649a2fcb62982cef31 Mon Sep 17 00:00:00 2001 From: ADmad Date: Tue, 4 Dec 2012 03:16:52 +0530 Subject: [PATCH 3/4] Fix docblock --- lib/Cake/Controller/Component/Acl/AclInterface.php | 4 ++-- lib/Cake/Controller/Component/Acl/DbAcl.php | 4 ++-- lib/Cake/Controller/Component/Acl/IniAcl.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Cake/Controller/Component/Acl/AclInterface.php b/lib/Cake/Controller/Component/Acl/AclInterface.php index 7cd98135b..24c85e9e4 100644 --- a/lib/Cake/Controller/Component/Acl/AclInterface.php +++ b/lib/Cake/Controller/Component/Acl/AclInterface.php @@ -8,7 +8,7 @@ * * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link http://cakephp.org CakePHP(tm) Project - * @package Cake.Controller.Component + * @package Cake.Controller.Component.Acl * @since CakePHP(tm) v 0.10.0.1076 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ @@ -17,7 +17,7 @@ * Access Control List interface. * Implementing classes are used by AclComponent to perform ACL checks in Cake. * - * @package Cake.Controller.Component + * @package Cake.Controller.Component.Acl */ interface AclInterface { diff --git a/lib/Cake/Controller/Component/Acl/DbAcl.php b/lib/Cake/Controller/Component/Acl/DbAcl.php index 37c756bcb..679bbd0df 100644 --- a/lib/Cake/Controller/Component/Acl/DbAcl.php +++ b/lib/Cake/Controller/Component/Acl/DbAcl.php @@ -8,7 +8,7 @@ * * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link http://cakephp.org CakePHP(tm) Project - * @package Cake.Controller.Component + * @package Cake.Controller.Component.Acl * @since CakePHP(tm) v 0.10.0.1076 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ @@ -32,7 +32,7 @@ App::uses('Hash', 'Utility'); * edit * }}} * - * @package Cake.Controller.Component + * @package Cake.Controller.Component.Acl */ class DbAcl extends Object implements AclInterface { diff --git a/lib/Cake/Controller/Component/Acl/IniAcl.php b/lib/Cake/Controller/Component/Acl/IniAcl.php index d915443fb..49ae575b5 100644 --- a/lib/Cake/Controller/Component/Acl/IniAcl.php +++ b/lib/Cake/Controller/Component/Acl/IniAcl.php @@ -8,7 +8,7 @@ * * @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) * @link http://cakephp.org CakePHP(tm) Project - * @package Cake.Controller.Component + * @package Cake.Controller.Component.Acl * @since CakePHP(tm) v 0.10.0.1076 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ @@ -18,7 +18,7 @@ App::uses('AclInterface', 'Controller/Component/Acl'); * IniAcl implements an access control system using an INI file. An example * of the ini file used can be found in /config/acl.ini.php. * - * @package Cake.Controller.Component + * @package Cake.Controller.Component.Acl */ class IniAcl extends Object implements AclInterface { From 6cf690398224b763dca966aa11477b08eb856527 Mon Sep 17 00:00:00 2001 From: mark_story Date: Fri, 7 Dec 2012 14:40:27 -0500 Subject: [PATCH 4/4] Fix incorrect argument order. --- lib/Cake/Utility/Hash.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Utility/Hash.php b/lib/Cake/Utility/Hash.php index a3c5cff6b..1ad205f62 100644 --- a/lib/Cake/Utility/Hash.php +++ b/lib/Cake/Utility/Hash.php @@ -96,7 +96,7 @@ class Hash { return (array)self::get($data, $path); } - if (strpos('[', $path) === false) { + if (strpos($path, '[') === false) { $tokens = explode('.', $path); } else { $tokens = String::tokenize($path, '.', '[', ']');