From e6aeae8935b4fc7b98b83c12601ba5bfd57ebb6a Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sun, 31 Oct 2010 22:41:33 -0400 Subject: [PATCH 01/15] Fixing issue where value in difference array was always the string value instead of the original value. --- cake/libs/model/cake_schema.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/libs/model/cake_schema.php b/cake/libs/model/cake_schema.php index 8135d186d..541cc943f 100644 --- a/cake/libs/model/cake_schema.php +++ b/cake/libs/model/cake_schema.php @@ -550,9 +550,9 @@ class CakeSchema extends Object { $difference[$key] = $value; continue; } - $value = strval($value); + $compare = strval($value); $correspondingValue = strval($correspondingValue); - if ($value === $correspondingValue) { + if ($compare === $correspondingValue) { continue; } $difference[$key] = $value; From 3dc1f6edfafbb27dd5af76e24f3e7ff1e42169eb Mon Sep 17 00:00:00 2001 From: Nigel Date: Tue, 2 Nov 2010 19:06:48 +0530 Subject: [PATCH 02/15] Fixed the minutes into seconds for session timeout Fixes #1255 Signed-off-by: mark_story --- app/config/core.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/config/core.php b/app/config/core.php index a0ae31f67..413718e8c 100644 --- a/app/config/core.php +++ b/app/config/core.php @@ -167,7 +167,7 @@ Configure::write('Session.cookie', 'CAKEPHP'); /** - * Session time out time (in minutes). + * Session time out time (in seconds). * Actual value depends on 'Security.level' setting. */ Configure::write('Session.timeout', '120'); From 2403d7fedce5cd1a5b30232b91614789c32ed4a4 Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 2 Nov 2010 21:43:33 -0400 Subject: [PATCH 03/15] Applying updates to skel/core.php. Fixes #1255 --- cake/console/templates/skel/config/core.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/console/templates/skel/config/core.php b/cake/console/templates/skel/config/core.php index a0ae31f67..413718e8c 100644 --- a/cake/console/templates/skel/config/core.php +++ b/cake/console/templates/skel/config/core.php @@ -167,7 +167,7 @@ Configure::write('Session.cookie', 'CAKEPHP'); /** - * Session time out time (in minutes). + * Session time out time (in seconds). * Actual value depends on 'Security.level' setting. */ Configure::write('Session.timeout', '120'); From d1403b0da8b0e2f1b4efad510e2891a0e4c50928 Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 2 Nov 2010 21:56:24 -0400 Subject: [PATCH 04/15] =?UTF-8?q?Changing=20NumberHelper::currency()=20to?= =?UTF-8?q?=20format=20<=201euro=20based=20on=20the=20suggestions=20from?= =?UTF-8?q?=20'Joel=20Haasnoot'.=20=20Instead=20of=2099c=20you=20will=20ge?= =?UTF-8?q?t=20=E2=82=AC0,99.=20Test=20cases=20updated.=20=20Fixes=20#1253?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cake/libs/view/helpers/number.php | 2 +- cake/tests/cases/libs/view/helpers/number.test.php | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cake/libs/view/helpers/number.php b/cake/libs/view/helpers/number.php index 236732a92..3abf3517f 100644 --- a/cake/libs/view/helpers/number.php +++ b/cake/libs/view/helpers/number.php @@ -48,7 +48,7 @@ class NumberHelper extends AppHelper { 'decimals' => '.', 'negative' => '()','escape' => false ), 'EUR' => array( - 'before'=>'€', 'after' => 'c', 'zero' => 0, 'places' => 2, 'thousands' => '.', + 'before'=>'€', 'after' => false, 'zero' => 0, 'places' => 2, 'thousands' => '.', 'decimals' => ',', 'negative' => '()', 'escape' => false ) ); diff --git a/cake/tests/cases/libs/view/helpers/number.test.php b/cake/tests/cases/libs/view/helpers/number.test.php index 9f2d238de..d5f88aa61 100644 --- a/cake/tests/cases/libs/view/helpers/number.test.php +++ b/cake/tests/cases/libs/view/helpers/number.test.php @@ -236,7 +236,7 @@ class NumberHelperTest extends CakeTestCase { $this->assertEqual($expected, $result); $result = $this->Number->currency($value, 'EUR'); - $expected = '99c'; + $expected = '€0,99'; $this->assertEqual($expected, $result); $result = $this->Number->currency($value, 'GBP'); @@ -258,7 +258,7 @@ class NumberHelperTest extends CakeTestCase { $this->assertEqual($expected, $result); $result = $this->Number->currency($value, 'EUR'); - $expected = '(99c)'; + $expected = '(€0,99)'; $this->assertEqual($expected, $result); $result = $this->Number->currency($value, 'GBP'); @@ -270,7 +270,7 @@ class NumberHelperTest extends CakeTestCase { $this->assertEqual($expected, $result); $result = $this->Number->currency($value, 'EUR', array('negative'=>'-')); - $expected = '-99c'; + $expected = '-€0,99'; $this->assertEqual($expected, $result); $result = $this->Number->currency($value, 'GBP', array('negative'=>'-')); @@ -336,6 +336,10 @@ class NumberHelperTest extends CakeTestCase { $result = $this->Number->currency('0.35', 'GBP'); $expected = '35p'; $this->assertEqual($expected, $result); + + $result = $this->Number->currency('0.35', 'EUR'); + $expected = '€0,35'; + $this->assertEqual($expected, $result); } /** From 81ce6f40b9f78d8e092d8672ad3bcbd5288412fb Mon Sep 17 00:00:00 2001 From: ADmad Date: Thu, 4 Nov 2010 17:59:23 +0530 Subject: [PATCH 05/15] Added test cases showing usage of 'full_base' key for url generation. Refs #1256 --- cake/tests/cases/libs/router.test.php | 18 ++++++++++-------- .../cases/libs/view/helpers/paginator.test.php | 14 ++++++++++++++ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index 2e69ab7fc..8346dfec8 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -74,6 +74,8 @@ class RouterTest extends CakeTestCase { function testFullBaseURL() { $this->assertPattern('/^http(s)?:\/\//', Router::url('/', true)); $this->assertPattern('/^http(s)?:\/\//', Router::url(null, true)); + $this->assertPattern('/^http(s)?:\/\//', Router::url(array('full_base' => true))); + $this->assertIdentical(FULL_BASE_URL . '/', Router::url(array('full_base' => true))); } /** @@ -1702,8 +1704,8 @@ class RouterTest extends CakeTestCase { function testParsingWithPatternOnAction() { Router::reload(); Router::connect( - '/blog/:action/*', - array('controller' => 'blog_posts'), + '/blog/:action/*', + array('controller' => 'blog_posts'), array('action' => 'other|actions') ); $result = Router::parse('/blog/other'); @@ -1725,7 +1727,7 @@ class RouterTest extends CakeTestCase { 'named' => array() ); $this->assertEqual($expected, $result); - + $result = Router::url(array('controller' => 'blog_posts', 'action' => 'foo')); $this->assertEqual('/blog_posts/foo', $result); @@ -2535,20 +2537,20 @@ class CakeRouteTestCase extends CakeTestCase { */ function testPatternOnAction() { $route =& new CakeRoute( - '/blog/:action/*', - array('controller' => 'blog_posts'), + '/blog/:action/*', + array('controller' => 'blog_posts'), array('action' => 'other|actions') ); $result = $route->match(array('controller' => 'blog_posts', 'action' => 'foo')); $this->assertFalse($result); - + $result = $route->match(array('controller' => 'blog_posts', 'action' => 'actions')); $this->assertTrue($result); - + $result = $route->parse('/blog/other'); $expected = array('controller' => 'blog_posts', 'action' => 'other', 'pass' => array(), 'named' => array()); $this->assertEqual($expected, $result); - + $result = $route->parse('/blog/foobar'); $this->assertFalse($result); } diff --git a/cake/tests/cases/libs/view/helpers/paginator.test.php b/cake/tests/cases/libs/view/helpers/paginator.test.php index f2f1a25e7..1e78415cd 100644 --- a/cake/tests/cases/libs/view/helpers/paginator.test.php +++ b/cake/tests/cases/libs/view/helpers/paginator.test.php @@ -21,6 +21,10 @@ App::import('Helper', array('Html', 'Paginator', 'Form', 'Ajax', 'Javascript', ' Mock::generate('JsHelper', 'PaginatorMockJsHelper'); +if (!defined('FULL_BASE_URL')) { + define('FULL_BASE_URL', 'http://cakephp.org'); +} + /** * PaginatorHelperTest class * @@ -1718,6 +1722,16 @@ class PaginatorHelperTest extends CakeTestCase { '/span', ); $this->assertTags($result, $expected); + + $this->Paginator->options(array('url' => array('full_base' => true))); + $result = $this->Paginator->first(); + + $expected = array( + ' array('href' => FULL_BASE_URL . '/index/page:1/sort:Client.name/direction:DESC')), '<< first', '/a', + '/span', + ); + $this->assertTags($result, $expected); } /** From d56b81218139db77f7fc7a75594aa97b47cc04d5 Mon Sep 17 00:00:00 2001 From: mark_story Date: Thu, 4 Nov 2010 21:08:40 -0400 Subject: [PATCH 06/15] Fixing issue where an array to string conversion error could occur if you had multiple values for a model's primary key and you created a matching form. Tests added. Fixes #1257 --- cake/libs/view/helpers/form.php | 3 ++- .../cases/libs/view/helpers/form.test.php | 25 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 9f7b5340b..538d844e5 100644 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -221,7 +221,8 @@ class FormHelper extends AppHelper { $data = $this->fieldset[$modelEntity]; $recordExists = ( isset($this->data[$model]) && - !empty($this->data[$model][$data['key']]) + !empty($this->data[$model][$data['key']]) && + !is_array($this->data[$model][$data['key']]) ); if ($recordExists) { diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index bc1683849..0dc83aed7 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -5626,6 +5626,31 @@ class FormHelperTest extends CakeTestCase { $this->assertTags($result, $expected, true); } +/** + * test that create() doesn't cause errors by multiple id's being in the primary key + * as could happen with multiple select or checkboxes. + * + * @return void + */ + function testCreateWithMultipleIdInData() { + $encoding = strtolower(Configure::read('App.encoding')); + + $this->Form->data['Contact']['id'] = array(1, 2); + $result = $this->Form->create('Contact'); + $expected = array( + 'form' => array( + 'id' => 'ContactAddForm', + 'method' => 'post', + 'action' => '/contacts/add', + 'accept-charset' => $encoding + ), + 'div' => array('style' => 'display:none;'), + 'input' => array('type' => 'hidden', 'name' => '_method', 'value' => 'POST'), + '/div' + ); + $this->assertTags($result, $expected); + } + /** * test that create() doesn't add in extra passed params. * From 268dae722e3ff663cfc2812e86a99ed8c254c96e Mon Sep 17 00:00:00 2001 From: mark_story Date: Fri, 5 Nov 2010 22:31:41 -0400 Subject: [PATCH 07/15] Reverting change from [16387f196191c5cb942f887f05456cb439944f41]. Using the constant caused a number of issues for several other people. Refs #1231 --- cake/dispatcher.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/dispatcher.php b/cake/dispatcher.php index 5080bfe90..1597c666f 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -339,7 +339,7 @@ class Dispatcher extends Object { if ($webroot === 'webroot' && $webroot === basename($base)) { $base = dirname($base); } - if ($dir === APP_DIR && $dir === basename($base)) { + if ($dir === 'app' && $dir === basename($base)) { $base = dirname($base); } From eb76ab95f23ba9daa2b97b365f63a783a7d302cc Mon Sep 17 00:00:00 2001 From: ADmad Date: Wed, 3 Nov 2010 18:55:42 +0530 Subject: [PATCH 08/15] Fixed issue where Model::saveAll() would incorrectly commit a transaction which was not started in that function call itself. --- cake/libs/model/model.php | 20 +++++++++++++------ .../cases/libs/model/model_write.test.php | 16 +++++++++++++++ cake/tests/cases/libs/model/models.php | 17 +++++++++++++--- 3 files changed, 44 insertions(+), 9 deletions(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 30ee27996..2cd1debaa 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -559,9 +559,9 @@ class Model extends Overloadable { * * Example: Turn off the associated Model Support request, * to temporarily lighten the User model: - * + * * `$this->User->unbindModel( array('hasMany' => array('Supportrequest')) );` - * + * * unbound models that are not made permanent will reset with the next call to Model::find() * * @param array $params Set of bindings to unbind (indexed by binding type) @@ -1589,7 +1589,7 @@ class Model extends Overloadable { } if ($options['atomic'] && $options['validate'] !== 'only') { - $db->begin($this); + $transactionBegun = $db->begin($this); } if (Set::numeric(array_keys($data))) { @@ -1629,8 +1629,12 @@ class Model extends Overloadable { break; default: if ($options['atomic']) { - if ($validates && ($db->commit($this) !== false)) { - return true; + if ($validates) { + if ($transactionBegun) { + return $db->commit($this) !== false; + } else { + return true; + } } $db->rollback($this); return false; @@ -1740,7 +1744,11 @@ class Model extends Overloadable { default: if ($options['atomic']) { if ($validates) { - return ($db->commit($this) !== false); + if ($transactionBegun) { + return $db->commit($this) !== false; + } else { + return true; + } } else { $db->rollback($this); } diff --git a/cake/tests/cases/libs/model/model_write.test.php b/cake/tests/cases/libs/model/model_write.test.php index 03b8d9c84..34133d31f 100644 --- a/cake/tests/cases/libs/model/model_write.test.php +++ b/cake/tests/cases/libs/model/model_write.test.php @@ -3121,6 +3121,22 @@ class ModelWriteTest extends BaseModelTest { $Post->saveAll($data); } +/** + * test saveAll with nested saveAll call. + * + * @return void + */ + function testSaveAllNestedSaveAll() { + $this->loadFixtures('Sample'); + $TransactionTestModel =& new TransactionTestModel(); + + $data = array( + array('apple_id' => 1, 'name' => 'sample5'), + ); + + $this->assertTrue($TransactionTestModel->saveAll($data, array('atomic' => true))); + } + /** * testSaveAllTransaction method * diff --git a/cake/tests/cases/libs/model/models.php b/cake/tests/cases/libs/model/models.php index 890b4f284..febb073cc 100644 --- a/cake/tests/cases/libs/model/models.php +++ b/cake/tests/cases/libs/model/models.php @@ -290,7 +290,7 @@ class Article extends CakeTestModel { */ class BeforeDeleteComment extends CakeTestModel { var $name = 'BeforeDeleteComment'; - + var $useTable = 'comments'; function beforeDelete($cascade = true) { @@ -3557,6 +3557,7 @@ class FruitNoWith extends CakeTestModel { ) ); } + class UuidTagNoWith extends CakeTestModel { var $name = 'UuidTag'; var $useTable = 'uuid_tags'; @@ -3573,11 +3574,21 @@ class UuidTagNoWith extends CakeTestModel { class ProductUpdateAll extends CakeTestModel { var $name = 'ProductUpdateAll'; var $useTable = 'product_update_all'; - } class GroupUpdateAll extends CakeTestModel { var $name = 'GroupUpdateAll'; var $useTable = 'group_update_all'; - } + +class TransactionTestModel extends CakeTestModel { + var $name = 'TransactionTestModel'; + var $useTable = 'samples'; + + function afterSave($created) { + $data = array( + array('apple_id' => 1, 'name' => 'sample6'), + ); + $this->saveAll($data, array('atomic' => true, 'callbacks' => false)); + } +} \ No newline at end of file From e431e86aa4301ced4273dc7919b59362cbb353cb Mon Sep 17 00:00:00 2001 From: mark_story Date: Sun, 7 Nov 2010 20:53:04 -0500 Subject: [PATCH 09/15] Fixing issue found by Felix Wilhelm(flxm) where users could send potentially dangerous or corrupted serialized objects to SecurityComponent, potentially allowing manipulation of file map caches. Test case added. --- cake/libs/controller/components/security.php | 7 +++++- .../controller/components/security.test.php | 24 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/cake/libs/controller/components/security.php b/cake/libs/controller/components/security.php index c267c6ce1..7e5b3b28f 100644 --- a/cake/libs/controller/components/security.php +++ b/cake/libs/controller/components/security.php @@ -618,10 +618,15 @@ class SecurityComponent extends Object { } unset($check['_Token']); + $locked = str_rot13($locked); + if (preg_match('/(\A|;|{|})O\:[0-9]+/', $locked)) { + return false; + } + $lockedFields = array(); $fields = Set::flatten($check); $fieldList = array_keys($fields); - $locked = unserialize(str_rot13($locked)); + $locked = unserialize($locked); $multi = array(); foreach ($fieldList as $i => $key) { diff --git a/cake/tests/cases/libs/controller/components/security.test.php b/cake/tests/cases/libs/controller/components/security.test.php index 883f1c810..bbd514100 100644 --- a/cake/tests/cases/libs/controller/components/security.test.php +++ b/cake/tests/cases/libs/controller/components/security.test.php @@ -608,6 +608,30 @@ DIGEST; $result = $this->Controller->Security->validatePost($this->Controller); $this->assertFalse($result, 'validatePost passed when key was missing. %s'); } + +/** + * Test that objects can't be passed into the serialized string. This was a vector for RFI and LFI + * attacks. Thanks to Felix Wilhelm + * + * @return void + */ + function testValidatePostObjectDeserialize() { + $this->Controller->Security->startup($this->Controller); + $key = $this->Controller->params['_Token']['key']; + $fields = 'a5475372b40f6e3ccbf9f8af191f20e1642fd877'; + + // a corrupted serialized object, so we can see if it ever gets to deserialize + $attack = 'O:3:"App":1:{s:5:"__map";a:1:{s:3:"foo";s:7:"Hacked!";s:1:"fail"}}'; + $fields .= urlencode(':' . str_rot13($attack)); + + $this->Controller->data = array( + 'Model' => array('username' => 'mark', 'password' => 'foo', 'valid' => '0'), + '_Token' => compact('key', 'fields') + ); + $result = $this->Controller->Security->validatePost($this->Controller); + $this->assertFalse($result, 'validatePost passed when key was missing. %s'); + } + /** * Tests validation of checkbox arrays * From bc7770aa83ef0fed5d523923ae91f4aad0a23c2b Mon Sep 17 00:00:00 2001 From: Ceeram Date: Mon, 8 Nov 2010 01:14:03 +0100 Subject: [PATCH 10/15] removing useless calls to mapActions() Signed-off-by: mark_story --- cake/libs/controller/components/auth.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php index 053514d19..759c5be36 100644 --- a/cake/libs/controller/components/auth.php +++ b/cake/libs/controller/components/auth.php @@ -527,7 +527,6 @@ class AuthComponent extends Object { $valid = $this->Acl->check($user, $this->action()); break; case 'crud': - $this->mapActions(); if (!isset($this->actionMap[$this->params['action']])) { trigger_error( sprintf(__('Auth::startup() - Attempted access of un-mapped action "%1$s" in controller "%2$s"', true), $this->params['action'], $this->params['controller']), @@ -542,7 +541,6 @@ class AuthComponent extends Object { } break; case 'model': - $this->mapActions(); $action = $this->params['action']; if (isset($this->actionMap[$action])) { $action = $this->actionMap[$action]; From e8678b38acc898f0756fdf8875d6661c3020b87f Mon Sep 17 00:00:00 2001 From: mark_story Date: Mon, 8 Nov 2010 21:50:45 -0500 Subject: [PATCH 11/15] Adding specific conditions to model->delete's call to dbo->delete. This helps fix a race condition where dbo->defaultConditions could cause additional data loss. Fixes #250 --- cake/libs/model/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 2cd1debaa..190a3660c 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -1831,7 +1831,7 @@ class Model extends Overloadable { )); } - if ($db->delete($this)) { + if ($db->delete($this, array($this->alias . '.' . $this->primaryKey => $id))) { if (!empty($this->belongsTo)) { $this->updateCounterCache($keys[$this->alias]); } From a1467822fbb50d4b524e2a98560ff74783f8af70 Mon Sep 17 00:00:00 2001 From: Mariano Iglesias Date: Wed, 10 Nov 2010 15:35:00 -0300 Subject: [PATCH 12/15] Fixing wrong assertion in test for CakeTestCase::testAction. Fixing testAction issue that would always include layout --- cake/tests/cases/libs/cake_test_case.test.php | 8 ++++---- cake/tests/lib/cake_test_case.php | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cake/tests/cases/libs/cake_test_case.test.php b/cake/tests/cases/libs/cake_test_case.test.php index f88b99378..e9f885fab 100644 --- a/cake/tests/cases/libs/cake_test_case.test.php +++ b/cake/tests/cases/libs/cake_test_case.test.php @@ -184,7 +184,7 @@ class CakeTestCaseTest extends CakeTestCase { '/a' ); $this->assertTrue($this->Case->assertTags($input, $pattern), 'Single quoted attributes %s'); - + $input = "My link"; $pattern = array( 'a' => array('href' => 'preg:/.*\.html/', 'class' => 'active'), @@ -348,10 +348,10 @@ class CakeTestCaseTest extends CakeTestCase { ), true); $result = $this->Case->testAction('/tests_apps/index', array('return' => 'view')); - $this->assertPattern('/This is the TestsAppsController index view/', $result); + $this->assertPattern('/^\s*This is the TestsAppsController index view\s*$/i', $result); $result = $this->Case->testAction('/tests_apps/index', array('return' => 'contents')); - $this->assertPattern('/This is the TestsAppsController index view/', $result); + $this->assertPattern('/\bThis is the TestsAppsController index view\b/i', $result); $this->assertPattern('/assertPattern('/<\/html>/', $result); @@ -499,4 +499,4 @@ class CakeTestCaseTest extends CakeTestCase { $return = $Dispatcher->dispatch('/tests_apps/index', array('autoRender' => 0, 'return' => 1, 'requested' => 1)); } -} +} \ No newline at end of file diff --git a/cake/tests/lib/cake_test_case.php b/cake/tests/lib/cake_test_case.php index 06a96b51d..1d4b89eb5 100644 --- a/cake/tests/lib/cake_test_case.php +++ b/cake/tests/lib/cake_test_case.php @@ -64,6 +64,10 @@ class CakeTestDispatcher extends Dispatcher { function _invoke(&$controller, $params, $missingAction = false) { $this->controller =& $controller; + if (array_key_exists('layout', $params)) { + $this->controller->layout = $params['layout']; + } + if (isset($this->testCase) && method_exists($this->testCase, 'startController')) { $this->testCase->startController($this->controller, $params); } @@ -828,4 +832,4 @@ class CakeTestCase extends UnitTestCase { return $permuted; } } -} +} \ No newline at end of file From 76a80c262e519bf256884de72f9a0909b04d9fca Mon Sep 17 00:00:00 2001 From: mark_story Date: Sat, 13 Nov 2010 12:04:22 -0500 Subject: [PATCH 13/15] Fixing failing test caused by name() being able to quote things better now. --- cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php b/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php index 59298f134..32dad2626 100644 --- a/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php @@ -824,7 +824,7 @@ class DboMysqlTest extends CakeTestCase { $this->db->virtualFieldSeparator = '_$_'; $result = $this->db->fields($model, null, array('data', 'other__field')); - $expected = array('`BinaryTest`.`data`', '(SUM(id)) AS BinaryTest_$_other__field'); + $expected = array('`BinaryTest`.`data`', '(SUM(id)) AS `BinaryTest_$_other__field`'); $this->assertEqual($result, $expected); } From 4c3337598e9355bd866f90c25253b39b908283a3 Mon Sep 17 00:00:00 2001 From: mark_story Date: Sat, 13 Nov 2010 20:01:20 -0500 Subject: [PATCH 14/15] Updating version numbers for 1.3.6 --- cake/VERSION.txt | 3 ++- cake/config/config.php | 2 +- cake/libs/view/pages/home.ctp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cake/VERSION.txt b/cake/VERSION.txt index 1f0f7116b..e5c64475c 100644 --- a/cake/VERSION.txt +++ b/cake/VERSION.txt @@ -18,7 +18,8 @@ // @license MIT License (http://www.opensource.org/licenses/mit-license.php) // +--------------------------------------------------------------------------------------------+ // //////////////////////////////////////////////////////////////////////////////////////////////////// -1.3.5 +1.3.6 + diff --git a/cake/config/config.php b/cake/config/config.php index 590aea6f8..09c4eec5b 100644 --- a/cake/config/config.php +++ b/cake/config/config.php @@ -17,4 +17,4 @@ * @since CakePHP(tm) v 1.1.11.4062 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -return $config['Cake.version'] = '1.3.5'; +return $config['Cake.version'] = '1.3.6'; diff --git a/cake/libs/view/pages/home.ctp b/cake/libs/view/pages/home.ctp index be2c09f28..e2cc74cee 100644 --- a/cake/libs/view/pages/home.ctp +++ b/cake/libs/view/pages/home.ctp @@ -21,7 +21,7 @@ if (Configure::read() == 0): endif; ?>

- + 0): Debugger::checkSecurityKeys(); From 5349257bbd90450ed0cfd60873d10274749e64b1 Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 16 Nov 2010 07:32:14 -0500 Subject: [PATCH 15/15] Changing empty() to !isset() to avoid additional cache hits when po files are missing or empty. --- cake/libs/i18n.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php index 74ab9406b..f1234d46a 100644 --- a/cake/libs/i18n.php +++ b/cake/libs/i18n.php @@ -148,11 +148,11 @@ class I18n extends Object { $_this->domain = $domain . '_' . $_this->l10n->lang; - if (empty($_this->__domains[$domain][$_this->__lang])) { + if (!isset($_this->__domains[$domain][$_this->__lang])) { $_this->__domains[$domain][$_this->__lang] = Cache::read($_this->domain, '_cake_core_'); } - if (empty($_this->__domains[$domain][$_this->__lang][$_this->category])) { + if (!isset($_this->__domains[$domain][$_this->__lang][$_this->category])) { $_this->__bindTextDomain($domain); Cache::write($_this->domain, $_this->__domains[$domain][$_this->__lang], '_cake_core_'); }