From a5d50da040225e764781b6524597069b131e81e1 Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 11 Feb 2014 16:38:24 -0500 Subject: [PATCH 1/5] Remove dead and unused code. --- lib/Cake/Console/Command/ConsoleShell.php | 4 ++-- lib/Cake/Model/Datasource/CakeSession.php | 1 - .../Model/Datasource/Database/Postgres.php | 1 - lib/Cake/Model/Datasource/Database/Sqlite.php | 3 +-- lib/Cake/Model/Datasource/DboSource.php | 7 +++---- .../Test/Case/Cache/Engine/FileEngineTest.php | 18 +++++++++--------- .../Case/Console/Command/SchemaShellTest.php | 2 +- .../Console/Command/Task/FixtureTaskTest.php | 5 ++--- .../Component/PaginatorComponentTest.php | 12 ++++++------ .../Component/SecurityComponentTest.php | 2 +- .../Controller/ControllerMergeVarsTest.php | 1 - lib/Cake/Test/Case/Routing/RouterTest.php | 2 -- .../TestSuite/Coverage/HtmlCoverageReport.php | 2 +- .../TestSuite/Reporter/CakeTextReporter.php | 3 --- lib/Cake/Utility/Debugger.php | 3 +-- lib/Cake/Utility/File.php | 2 +- 16 files changed, 28 insertions(+), 40 deletions(-) diff --git a/lib/Cake/Console/Command/ConsoleShell.php b/lib/Cake/Console/Command/ConsoleShell.php index 2c6d1381e..177b13353 100644 --- a/lib/Cake/Console/Command/ConsoleShell.php +++ b/lib/Cake/Console/Command/ConsoleShell.php @@ -329,7 +329,7 @@ class ConsoleShell extends AppShell { $command = str_replace($this->badCommandChars, "", $command); // Do we have a valid model? - list($modelToCheck, $tmp) = explode('->', $command); + list($modelToCheck) = explode('->', $command); if ($this->_isValidModel($modelToCheck)) { $findCommand = "\$data = \$this->$command;"; @@ -390,7 +390,7 @@ class ConsoleShell extends AppShell { // Validate the model we're trying to save here $command = strip_tags($command); $command = str_replace($this->badCommandChars, "", $command); - list($modelToSave, $tmp) = explode("->", $command); + list($modelToSave) = explode("->", $command); if ($this->_isValidModel($modelToSave)) { // Extract the array of data we are trying to build diff --git a/lib/Cake/Model/Datasource/CakeSession.php b/lib/Cake/Model/Datasource/CakeSession.php index a423a39e4..431bd405e 100644 --- a/lib/Cake/Model/Datasource/CakeSession.php +++ b/lib/Cake/Model/Datasource/CakeSession.php @@ -135,7 +135,6 @@ class CakeSession { */ public static function init($base = null) { self::$time = time(); - $checkAgent = Configure::read('Session.checkAgent'); if (env('HTTP_USER_AGENT')) { self::$_userAgent = md5(env('HTTP_USER_AGENT') . Configure::read('Security.salt')); diff --git a/lib/Cake/Model/Datasource/Database/Postgres.php b/lib/Cake/Model/Datasource/Database/Postgres.php index 9c71c592a..ed2983611 100644 --- a/lib/Cake/Model/Datasource/Database/Postgres.php +++ b/lib/Cake/Model/Datasource/Database/Postgres.php @@ -669,7 +669,6 @@ class Postgres extends DboSource { } $col = str_replace(')', '', $real); - $limit = null; if (strpos($col, '(') !== false) { list($col, $limit) = explode('(', $col); diff --git a/lib/Cake/Model/Datasource/Database/Sqlite.php b/lib/Cake/Model/Datasource/Database/Sqlite.php index 6762c958b..d831e9ea0 100644 --- a/lib/Cake/Model/Datasource/Database/Sqlite.php +++ b/lib/Cake/Model/Datasource/Database/Sqlite.php @@ -250,9 +250,8 @@ class Sqlite extends DboSource { } $col = strtolower(str_replace(')', '', $real)); - $limit = null; if (strpos($col, '(') !== false) { - list($col, $limit) = explode('(', $col); + list($col) = explode('(', $col); } $standard = array( diff --git a/lib/Cake/Model/Datasource/DboSource.php b/lib/Cake/Model/Datasource/DboSource.php index 5e8b5b795..68733daeb 100644 --- a/lib/Cake/Model/Datasource/DboSource.php +++ b/lib/Cake/Model/Datasource/DboSource.php @@ -2734,7 +2734,7 @@ class DboSource extends DataSource { if (is_object($model) && $model->isVirtualField($key)) { $key = '(' . $this->_quoteFields($model->getVirtualField($key)) . ')'; } - list($alias, $field) = pluginSplit($key); + list($alias) = pluginSplit($key); if (is_object($model) && $alias !== $model->alias && is_object($model->{$alias}) && $model->{$alias}->isVirtualField($key)) { $key = '(' . $this->_quoteFields($model->{$alias}->getVirtualField($key)) . ')'; } @@ -2832,7 +2832,7 @@ class DboSource extends DataSource { 'int' => 1, 'tinyint' => 1, 'smallint' => 1, 'mediumint' => 1, 'integer' => 1, 'bigint' => 1 ); - list($real, $type, $length, $offset, $sign, $zerofill) = $result; + list($real, $type, $length, $offset, $sign) = $result; $typeArr = $type; $type = $type[0]; $length = $length[0]; @@ -3241,13 +3241,12 @@ class DboSource extends DataSource { } $isAllFloat = $isAllInt = true; - $containsFloat = $containsInt = $containsString = false; + $containsInt = $containsString = false; foreach ($value as $valElement) { $valElement = trim($valElement); if (!is_float($valElement) && !preg_match('/^[\d]+\.[\d]+$/', $valElement)) { $isAllFloat = false; } else { - $containsFloat = true; continue; } if (!is_int($valElement) && !preg_match('/^[\d]+$/', $valElement)) { diff --git a/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php b/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php index ff95a2b7b..845dfb86a 100644 --- a/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php +++ b/lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php @@ -196,9 +196,9 @@ class FileEngineTest extends CakeTestCase { Cache::config('file_test', array('engine' => 'File', 'duration' => 1)); $data = 'this is a test of the emergency broadcasting system'; - $write = Cache::write('serialize_test1', $data, 'file_test'); - $write = Cache::write('serialize_test2', $data, 'file_test'); - $write = Cache::write('serialize_test3', $data, 'file_test'); + Cache::write('serialize_test1', $data, 'file_test'); + Cache::write('serialize_test2', $data, 'file_test'); + Cache::write('serialize_test3', $data, 'file_test'); $this->assertTrue(file_exists(CACHE . 'cake_serialize_test1')); $this->assertTrue(file_exists(CACHE . 'cake_serialize_test2')); $this->assertTrue(file_exists(CACHE . 'cake_serialize_test3')); @@ -210,9 +210,9 @@ class FileEngineTest extends CakeTestCase { $this->assertFalse(file_exists(CACHE . 'cake_serialize_test3')); $data = 'this is a test of the emergency broadcasting system'; - $write = Cache::write('serialize_test1', $data, 'file_test'); - $write = Cache::write('serialize_test2', $data, 'file_test'); - $write = Cache::write('serialize_test3', $data, 'file_test'); + Cache::write('serialize_test1', $data, 'file_test'); + Cache::write('serialize_test2', $data, 'file_test'); + Cache::write('serialize_test3', $data, 'file_test'); $this->assertTrue(file_exists(CACHE . 'cake_serialize_test1')); $this->assertTrue(file_exists(CACHE . 'cake_serialize_test2')); $this->assertTrue(file_exists(CACHE . 'cake_serialize_test3')); @@ -413,7 +413,7 @@ class FileEngineTest extends CakeTestCase { Cache::drop('mask_test'); Cache::config('mask_test', array('engine' => 'File', 'mask' => 0666, 'path' => TMP . 'tests')); - $write = Cache::write('masking_test', $data, 'mask_test'); + Cache::write('masking_test', $data, 'mask_test'); $result = substr(sprintf('%o', fileperms(TMP . 'tests' . DS . 'cake_masking_test')), -4); $expected = '0666'; $this->assertEquals($expected, $result); @@ -421,7 +421,7 @@ class FileEngineTest extends CakeTestCase { Cache::drop('mask_test'); Cache::config('mask_test', array('engine' => 'File', 'mask' => 0644, 'path' => TMP . 'tests')); - $write = Cache::write('masking_test', $data, 'mask_test'); + Cache::write('masking_test', $data, 'mask_test'); $result = substr(sprintf('%o', fileperms(TMP . 'tests' . DS . 'cake_masking_test')), -4); $expected = '0644'; $this->assertEquals($expected, $result); @@ -429,7 +429,7 @@ class FileEngineTest extends CakeTestCase { Cache::drop('mask_test'); Cache::config('mask_test', array('engine' => 'File', 'mask' => 0640, 'path' => TMP . 'tests')); - $write = Cache::write('masking_test', $data, 'mask_test'); + Cache::write('masking_test', $data, 'mask_test'); $result = substr(sprintf('%o', fileperms(TMP . 'tests' . DS . 'cake_masking_test')), -4); $expected = '0640'; $this->assertEquals($expected, $result); diff --git a/lib/Cake/Test/Case/Console/Command/SchemaShellTest.php b/lib/Cake/Test/Case/Console/Command/SchemaShellTest.php index 8a4cae864..ecf0a0c20 100644 --- a/lib/Cake/Test/Case/Console/Command/SchemaShellTest.php +++ b/lib/Cake/Test/Case/Console/Command/SchemaShellTest.php @@ -527,7 +527,7 @@ class SchemaShellTest extends CakeTestCase { $this->Shell->expects($this->any()) ->method('in') ->will($this->returnValue('y')); - $r = $this->Shell->expects($this->once()) + $this->Shell->expects($this->once()) ->method('_run') ->with($this->arrayHasKey('newone'), 'update', $this->isInstanceOf('CakeSchema')); diff --git a/lib/Cake/Test/Case/Console/Command/Task/FixtureTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/FixtureTaskTest.php index 3bb8175d6..3357d328b 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/FixtureTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/FixtureTaskTest.php @@ -427,9 +427,8 @@ class FixtureTaskTest extends CakeTestCase { $this->Task->expects($this->at(1))->method('createFile') ->with($filename, $this->stringContains('Task->generateFixtureFile('Article', array()); - - $result = $this->Task->generateFixtureFile('Article', array()); + $this->Task->generateFixtureFile('Article', array()); + $this->Task->generateFixtureFile('Article', array()); } /** diff --git a/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php b/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php index 65a7f4f00..b27c41117 100644 --- a/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php @@ -609,7 +609,7 @@ class PaginatorComponentTest extends CakeTestCase { $this->assertEmpty($result['order']); $Controller->PaginatorControllerPost->order = 'PaginatorControllerPost.id'; - $results = $Controller->Paginator->validateSort($Controller->PaginatorControllerPost, array()); + $result = $Controller->Paginator->validateSort($Controller->PaginatorControllerPost, array()); $this->assertEmpty($result['order']); $Controller->PaginatorControllerPost->order = array( @@ -1124,26 +1124,26 @@ class PaginatorComponentTest extends CakeTestCase { $Controller->request->params['named'] = array( 'contain' => array('ControllerComment'), 'limit' => '1000' ); - $result = $Controller->paginate('PaginatorControllerPost'); + $Controller->paginate('PaginatorControllerPost'); $this->assertEquals(100, $Controller->params['paging']['PaginatorControllerPost']['options']['limit']); $Controller->request->params['named'] = array( 'contain' => array('ControllerComment'), 'limit' => '1000', 'maxLimit' => 1000 ); - $result = $Controller->paginate('PaginatorControllerPost'); + $Controller->paginate('PaginatorControllerPost'); $this->assertEquals(100, $Controller->params['paging']['PaginatorControllerPost']['options']['limit']); $Controller->request->params['named'] = array('contain' => array('ControllerComment'), 'limit' => '10'); - $result = $Controller->paginate('PaginatorControllerPost'); + $Controller->paginate('PaginatorControllerPost'); $this->assertEquals(10, $Controller->params['paging']['PaginatorControllerPost']['options']['limit']); $Controller->request->params['named'] = array('contain' => array('ControllerComment'), 'limit' => '1000'); $Controller->paginate = array('maxLimit' => 2000, 'paramType' => 'named'); - $result = $Controller->paginate('PaginatorControllerPost'); + $Controller->paginate('PaginatorControllerPost'); $this->assertEquals(1000, $Controller->params['paging']['PaginatorControllerPost']['options']['limit']); $Controller->request->params['named'] = array('contain' => array('ControllerComment'), 'limit' => '5000'); - $result = $Controller->paginate('PaginatorControllerPost'); + $Controller->paginate('PaginatorControllerPost'); $this->assertEquals(2000, $Controller->params['paging']['PaginatorControllerPost']['options']['limit']); } diff --git a/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php b/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php index a90a3bce1..16ac972b4 100644 --- a/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php @@ -607,7 +607,7 @@ class SecurityComponentTest extends CakeTestCase { $fields = '69f493434187b867ea14b901fdf58b55d27c935d%3A'; $unlocked = ''; - $this->Controller->request->data = $data = array( + $this->Controller->request->data = array( 'Model' => array('username' => '', 'password' => ''), '_Token' => compact('key', 'fields', 'unlocked') ); diff --git a/lib/Cake/Test/Case/Controller/ControllerMergeVarsTest.php b/lib/Cake/Test/Case/Controller/ControllerMergeVarsTest.php index 13e9d3bdf..5397208e2 100644 --- a/lib/Cake/Test/Case/Controller/ControllerMergeVarsTest.php +++ b/lib/Cake/Test/Case/Controller/ControllerMergeVarsTest.php @@ -243,7 +243,6 @@ class ControllerMergeVarsTest extends CakeTestCase { public function testMergeVarsModelClass() { $Controller = new MergeVariablescontroller(); $Controller->uses = array('Test', 'TestAlias'); - $lastModel = end($Controller->uses); $Controller->constructClasses(); $this->assertEquals($Controller->uses[0], $Controller->modelClass); } diff --git a/lib/Cake/Test/Case/Routing/RouterTest.php b/lib/Cake/Test/Case/Routing/RouterTest.php index 6a7cf05a7..2cdc6ed6e 100644 --- a/lib/Cake/Test/Case/Routing/RouterTest.php +++ b/lib/Cake/Test/Case/Routing/RouterTest.php @@ -2272,14 +2272,12 @@ class RouterTest extends CakeTestCase { $this->assertEquals(array_merge($url, array('plugin' => null)), $route->defaults); // test that the first route is matched - $newUrl = array('controller' => 'products', 'action' => 'display', 6); Router::connect('/government', $url); Router::parse('/government'); $route = Router::requestRoute(); $this->assertEquals(array_merge($url, array('plugin' => null)), $route->defaults); // test that an unmatched route does not change the current route - $newUrl = array('controller' => 'products', 'action' => 'display', 6); Router::connect('/actor', $url); Router::parse('/government'); $route = Router::requestRoute(); diff --git a/lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php b/lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php index e82fe3256..be0da58ba 100644 --- a/lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php +++ b/lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php @@ -181,7 +181,7 @@ HTML; */ public function coverageHeader($filename, $percent) { $filename = basename($filename); - list($file, $ext) = explode('.', $filename); + list($file) = explode('.', $filename); $display = in_array($file, $this->_testNames) ? 'block' : 'none'; $primary = $display === 'block' ? 'primary' : ''; return <<params['plugin']; $buffer = "Core Test Cases:\n"; - $urlExtra = ''; if ($app) { $buffer = "App Test Cases:\n"; - $urlExtra = '&app=true'; } elseif ($plugin) { $buffer = Inflector::humanize($plugin) . " Test Cases:\n"; - $urlExtra = '&plugin=' . $plugin; } if (count($testCases) < 1) { diff --git a/lib/Cake/Utility/Debugger.php b/lib/Cake/Utility/Debugger.php index 96482daf1..ad6ff9a01 100644 --- a/lib/Cake/Utility/Debugger.php +++ b/lib/Cake/Utility/Debugger.php @@ -536,9 +536,8 @@ class Debugger { $var = $replace + $var; $out = "array("; - $n = $break = $end = null; + $break = $end = null; if (!empty($var)) { - $n = "\n"; $break = "\n" . str_repeat("\t", $indent); $end = "\n" . str_repeat("\t", $indent - 1); } diff --git a/lib/Cake/Utility/File.php b/lib/Cake/Utility/File.php index 1af27d579..933250ed5 100644 --- a/lib/Cake/Utility/File.php +++ b/lib/Cake/Utility/File.php @@ -558,7 +558,7 @@ class File { if (!$finfo) { return false; } - list($type, $charset) = explode(';', $finfo); + list($type) = explode(';', $finfo); return $type; } if (function_exists('mime_content_type')) { From 96a37d5917307baa9cf9229cda94da0fc6686fbc Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 11 Feb 2014 21:56:05 -0500 Subject: [PATCH 2/5] Fix temporary associations that replace fields not being restored. When binding temporary associations, fields should be restored in the afterFind as the association will have become unbound. Fixes #2816 --- lib/Cake/Model/Behavior/TranslateBehavior.php | 13 +++++++++-- .../Model/Behavior/TranslateBehaviorTest.php | 23 +++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Model/Behavior/TranslateBehavior.php b/lib/Cake/Model/Behavior/TranslateBehavior.php index 154f52c59..4ebdfdb55 100644 --- a/lib/Cake/Model/Behavior/TranslateBehavior.php +++ b/lib/Cake/Model/Behavior/TranslateBehavior.php @@ -279,7 +279,13 @@ class TranslateBehavior extends ModelBehavior { */ public function afterFind(Model $Model, $results, $primary = false) { $Model->virtualFields = $this->runtime[$Model->alias]['virtualFields']; + $this->runtime[$Model->alias]['virtualFields'] = $this->runtime[$Model->alias]['fields'] = array(); + if (!empty($this->runtime[$Model->alias]['restoreFields'])) { + $this->runtime[$Model->alias]['fields'] = $this->runtime[$Model->alias]['restoreFields']; + unset($this->runtime[$Model->alias]['restoreFields']); + } + $locale = $this->_getLocale($Model); if (empty($locale) || empty($results) || empty($this->runtime[$Model->alias]['beforeFind'])) { @@ -577,7 +583,10 @@ class TranslateBehavior extends ModelBehavior { } $associations = array(); $RuntimeModel = $this->translateModel($Model); - $default = array('className' => $RuntimeModel->alias, 'foreignKey' => 'foreign_key'); + $default = array( + 'className' => $RuntimeModel->alias, + 'foreignKey' => 'foreign_key' + ); foreach ($fields as $key => $value) { if (is_numeric($key)) { @@ -592,7 +601,6 @@ class TranslateBehavior extends ModelBehavior { __d('cake_dev', 'You cannot bind a translation named "name".') ); } - $this->_removeField($Model, $field); if ($association === null) { @@ -604,6 +612,7 @@ class TranslateBehavior extends ModelBehavior { } else { if ($reset) { $this->runtime[$Model->alias]['fields'][$field] = $association; + $this->runtime[$Model->alias]['restoreFields'][] = $field; } else { $this->settings[$Model->alias][$field] = $association; } diff --git a/lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php b/lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php index 6c9fcdffb..ba584402e 100644 --- a/lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php +++ b/lib/Cake/Test/Case/Model/Behavior/TranslateBehaviorTest.php @@ -1057,6 +1057,29 @@ class TranslateBehaviorTest extends CakeTestCase { $this->assertFalse(empty($result)); } +/** + * test restoring fields after temporary binds method + * + * @return void + */ + public function testFieldsRestoreAfterBind() { + $this->loadFixtures('Translate', 'TranslatedItem'); + + $TestModel = new TranslatedItem(); + + $translations = array('title' => 'Title'); + $TestModel->bindTranslation($translations); + + $result = $TestModel->find('first'); + $this->assertArrayHasKey('Title', $result); + $this->assertArrayHasKey('content', $result['Title'][0]); + $this->assertArrayNotHasKey('title', $result); + + $result = $TestModel->find('first'); + $this->assertArrayNotHasKey('Title', $result); + $this->assertEquals('Title #1', $result['TranslatedItem']['title']); + } + /** * testAttachDetach method * From 827dc77a1114be297ff4b8e2a651ee400740c059 Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 11 Feb 2014 22:00:24 -0500 Subject: [PATCH 3/5] Fix incorrect assertion. --- .../Test/Case/Controller/Component/PaginatorComponentTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php b/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php index b27c41117..5e99ed2a0 100644 --- a/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php @@ -610,7 +610,7 @@ class PaginatorComponentTest extends CakeTestCase { $Controller->PaginatorControllerPost->order = 'PaginatorControllerPost.id'; $result = $Controller->Paginator->validateSort($Controller->PaginatorControllerPost, array()); - $this->assertEmpty($result['order']); + $this->assertArrayNotHasKey('order', $result); $Controller->PaginatorControllerPost->order = array( 'PaginatorControllerPost.id', From 1725386c16c1d4f272d1e8bd4a374bdf0f49fb82 Mon Sep 17 00:00:00 2001 From: euromark Date: Wed, 12 Feb 2014 21:52:18 +0100 Subject: [PATCH 4/5] Fix uploadError validation rule to work with OS Win. Here the error is string, not integer. --- lib/Cake/Test/Case/Utility/ValidationTest.php | 2 ++ lib/Cake/Utility/Validation.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Test/Case/Utility/ValidationTest.php b/lib/Cake/Test/Case/Utility/ValidationTest.php index cc60f7df9..aef449c74 100644 --- a/lib/Cake/Test/Case/Utility/ValidationTest.php +++ b/lib/Cake/Test/Case/Utility/ValidationTest.php @@ -2368,9 +2368,11 @@ class ValidationTest extends CakeTestCase { public function testUploadError() { $this->assertTrue(Validation::uploadError(0)); $this->assertTrue(Validation::uploadError(array('error' => 0))); + $this->assertTrue(Validation::uploadError(array('error' => '0'))); $this->assertFalse(Validation::uploadError(2)); $this->assertFalse(Validation::uploadError(array('error' => 2))); + $this->assertFalse(Validation::uploadError(array('error' => '2'))); } /** diff --git a/lib/Cake/Utility/Validation.php b/lib/Cake/Utility/Validation.php index e78a956cf..b990b6ca9 100644 --- a/lib/Cake/Utility/Validation.php +++ b/lib/Cake/Utility/Validation.php @@ -964,7 +964,7 @@ class Validation { $check = $check['error']; } - return $check === UPLOAD_ERR_OK; + return (int)$check === UPLOAD_ERR_OK; } /** From 54a395cc3ea64a4ba84bae1740fd88a1919d7a36 Mon Sep 17 00:00:00 2001 From: ADmad Date: Thu, 13 Feb 2014 17:54:53 +0530 Subject: [PATCH 5/5] Updated docblock. BlowfishAuthenticate is deprecated. --- lib/Cake/Utility/Security.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Utility/Security.php b/lib/Cake/Utility/Security.php index 0775862be..1851968c2 100644 --- a/lib/Cake/Utility/Security.php +++ b/lib/Cake/Utility/Security.php @@ -85,7 +85,7 @@ class Security { * you ensuring that each hashed password will have a *unique* salt. * - Comparing Hashes: Simply pass the originally hashed password as the salt. * The salt is prepended to the hash and php handles the parsing automagically. - * For convenience the BlowfishAuthenticate adapter is available for use with + * For convenience the `BlowfishPasswordHasher` class is available for use with * the AuthComponent. * - Do NOT use a constant salt for blowfish! *