From a0eb736151d7c1110b3b11e88e7117f0d30e4e9b Mon Sep 17 00:00:00 2001 From: mark_story Date: Mon, 28 Apr 2014 20:35:20 -0400 Subject: [PATCH 01/13] Update version number to 2.4.8 --- 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 ddabde088..928b2197b 100644 --- a/lib/Cake/VERSION.txt +++ b/lib/Cake/VERSION.txt @@ -17,4 +17,4 @@ // @license http://www.opensource.org/licenses/mit-license.php MIT License // +--------------------------------------------------------------------------------------------+ // //////////////////////////////////////////////////////////////////////////////////////////////////// -2.4.7 +2.4.8 From 1d1a2f859c7dd0434e29524a48a573f3e0afe889 Mon Sep 17 00:00:00 2001 From: mark_story Date: Mon, 28 Apr 2014 20:56:06 -0400 Subject: [PATCH 02/13] Fix coding standards error. --- .../Test/Case/Controller/Component/SecurityComponentTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php b/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php index b470fba63..4b6e0f1a1 100644 --- a/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php +++ b/lib/Cake/Test/Case/Controller/Component/SecurityComponentTest.php @@ -1132,7 +1132,6 @@ class SecurityComponentTest extends CakeTestCase { $this->assertFalse($this->Controller->Security->validatePost($this->Controller)); } - /** * test that a requestAction's controller will have the _Token appended to * the params. From bd074e7dc7cb0efb9f96220a6bb5540ca30a247e Mon Sep 17 00:00:00 2001 From: euromark Date: Tue, 29 Apr 2014 12:05:47 +0200 Subject: [PATCH 03/13] Stricter string comparisons. --- lib/Cake/Controller/Component/AuthComponent.php | 2 +- lib/Cake/Controller/Component/PaginatorComponent.php | 2 +- lib/Cake/Controller/Component/RequestHandlerComponent.php | 2 +- lib/Cake/Controller/Component/SecurityComponent.php | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/Cake/Controller/Component/AuthComponent.php b/lib/Cake/Controller/Component/AuthComponent.php index 42bf84839..8f4fb279e 100644 --- a/lib/Cake/Controller/Component/AuthComponent.php +++ b/lib/Cake/Controller/Component/AuthComponent.php @@ -722,7 +722,7 @@ class AuthComponent extends Component { $redir = $this->Session->read('Auth.redirect'); $this->Session->delete('Auth.redirect'); - if (Router::normalize($redir) == Router::normalize($this->loginAction)) { + if (Router::normalize($redir) === Router::normalize($this->loginAction)) { $redir = $this->loginRedirect; } } elseif ($this->loginRedirect) { diff --git a/lib/Cake/Controller/Component/PaginatorComponent.php b/lib/Cake/Controller/Component/PaginatorComponent.php index 32107f413..d848977b1 100644 --- a/lib/Cake/Controller/Component/PaginatorComponent.php +++ b/lib/Cake/Controller/Component/PaginatorComponent.php @@ -392,7 +392,7 @@ class PaginatorComponent extends Component { if (strpos($key, '.') !== false) { list($alias, $field) = explode('.', $key); } - $correctAlias = ($object->alias == $alias); + $correctAlias = ($object->alias === $alias); if ($correctAlias && $object->hasField($field)) { $order[$object->alias . '.' . $field] = $value; diff --git a/lib/Cake/Controller/Component/RequestHandlerComponent.php b/lib/Cake/Controller/Component/RequestHandlerComponent.php index 723606284..dfe5af6df 100644 --- a/lib/Cake/Controller/Component/RequestHandlerComponent.php +++ b/lib/Cake/Controller/Component/RequestHandlerComponent.php @@ -525,7 +525,7 @@ class RequestHandlerComponent extends Component { return $this->mapType($contentType); } if (is_string($type)) { - return ($type == $this->mapType($contentType)); + return ($type === $this->mapType($contentType)); } } diff --git a/lib/Cake/Controller/Component/SecurityComponent.php b/lib/Cake/Controller/Component/SecurityComponent.php index 6aeb77ef2..4bd42bd0c 100644 --- a/lib/Cake/Controller/Component/SecurityComponent.php +++ b/lib/Cake/Controller/Component/SecurityComponent.php @@ -230,7 +230,7 @@ class SecurityComponent extends Component { $controller->request->params['requested'] != 1 ); - if ($this->_action == $this->blackHoleCallback) { + if ($this->_action === $this->blackHoleCallback) { return $this->blackHole($controller, 'auth'); } @@ -362,7 +362,7 @@ class SecurityComponent extends Component { $property = 'require' . $method; if (is_array($this->$property) && !empty($this->$property)) { $require = $this->$property; - if (in_array($this->_action, $require) || $this->$property == array('*')) { + if (in_array($this->_action, $require) || $this->$property === array('*')) { if (!$this->request->is($method)) { if (!$this->blackHole($controller, $method)) { return null; @@ -384,7 +384,7 @@ class SecurityComponent extends Component { if (is_array($this->requireSecure) && !empty($this->requireSecure)) { $requireSecure = $this->requireSecure; - if (in_array($this->_action, $requireSecure) || $this->requireSecure == array('*')) { + if (in_array($this->_action, $requireSecure) || $this->requireSecure === array('*')) { if (!$this->request->is('ssl')) { if (!$this->blackHole($controller, 'secure')) { return null; @@ -405,7 +405,7 @@ class SecurityComponent extends Component { if (is_array($this->requireAuth) && !empty($this->requireAuth) && !empty($this->request->data)) { $requireAuth = $this->requireAuth; - if (in_array($this->request->params['action'], $requireAuth) || $this->requireAuth == array('*')) { + if (in_array($this->request->params['action'], $requireAuth) || $this->requireAuth === array('*')) { if (!isset($controller->request->data['_Token'])) { if (!$this->blackHole($controller, 'auth')) { return null; From 7a287a694263f65fd9719695980d4628f484c6f2 Mon Sep 17 00:00:00 2001 From: euromark Date: Tue, 29 Apr 2014 14:19:33 +0200 Subject: [PATCH 04/13] More coding standard corrections. --- lib/Cake/Console/Command/ConsoleShell.php | 2 +- lib/Cake/Console/Command/ServerShell.php | 2 +- lib/Cake/Console/Command/Task/DbConfigTask.php | 2 +- lib/Cake/Console/Command/Task/ExtractTask.php | 2 +- lib/Cake/Console/Command/Task/ModelTask.php | 4 ++-- lib/Cake/Console/Command/Task/TestTask.php | 2 +- lib/Cake/Console/Command/Task/ViewTask.php | 2 +- lib/Cake/Console/Command/UpgradeShell.php | 2 +- lib/Cake/Console/ConsoleInput.php | 2 +- lib/Cake/Console/Templates/default/views/form.ctp | 2 +- lib/Cake/Console/Templates/skel/View/Layouts/flash.ctp | 2 +- lib/Cake/Controller/Component/Acl/PhpAcl.php | 4 ++-- lib/Cake/Controller/Component/AuthComponent.php | 2 +- lib/Cake/Controller/Component/PaginatorComponent.php | 2 +- lib/Cake/Controller/Component/RequestHandlerComponent.php | 2 +- lib/Cake/Controller/Component/SecurityComponent.php | 8 ++++---- lib/Cake/Core/App.php | 2 +- lib/Cake/Log/Engine/FileLog.php | 2 +- lib/Cake/Model/Behavior/ContainableBehavior.php | 4 ++-- lib/Cake/Model/Behavior/TranslateBehavior.php | 2 +- lib/Cake/Model/Behavior/TreeBehavior.php | 5 +++-- lib/Cake/Model/BehaviorCollection.php | 2 +- lib/Cake/Model/CakeSchema.php | 4 ++-- lib/Cake/Model/Datasource/Database/Mysql.php | 4 ++-- lib/Cake/Model/Datasource/Database/Postgres.php | 6 +++--- lib/Cake/Model/Datasource/Database/Sqlserver.php | 2 +- lib/Cake/Model/Datasource/DboSource.php | 8 ++++---- lib/Cake/Model/Model.php | 6 +++--- lib/Cake/Network/CakeRequest.php | 2 +- lib/Cake/Network/CakeResponse.php | 2 +- lib/Cake/Routing/Filter/AssetDispatcher.php | 2 +- lib/Cake/Test/Case/BasicsTest.php | 2 +- lib/Cake/Test/Case/Model/Datasource/CakeSessionTest.php | 2 +- .../Test/Case/Model/Datasource/Database/MysqlTest.php | 4 ++-- lib/Cake/Test/Case/TestSuite/HtmlCoverageReportTest.php | 4 ++-- lib/Cake/Test/Case/Utility/DebuggerTest.php | 4 ++-- lib/Cake/Utility/CakeTime.php | 2 +- lib/Cake/Utility/Folder.php | 4 ++-- lib/Cake/View/Helper/FormHelper.php | 2 +- lib/Cake/View/Helper/HtmlHelper.php | 2 +- 40 files changed, 61 insertions(+), 60 deletions(-) diff --git a/lib/Cake/Console/Command/ConsoleShell.php b/lib/Cake/Console/Command/ConsoleShell.php index 177b13353..d90c26161 100644 --- a/lib/Cake/Console/Command/ConsoleShell.php +++ b/lib/Cake/Console/Command/ConsoleShell.php @@ -304,7 +304,7 @@ class ConsoleShell extends AppShell { $validCurrentAssociation = false; foreach ($currentAssociations as $model => $currentAssociation) { - if ($model == $modelB && $association == $currentAssociation) { + if ($model === $modelB && $association === $currentAssociation) { $validCurrentAssociation = true; } } diff --git a/lib/Cake/Console/Command/ServerShell.php b/lib/Cake/Console/Command/ServerShell.php index 7247973c0..14228d316 100644 --- a/lib/Cake/Console/Command/ServerShell.php +++ b/lib/Cake/Console/Command/ServerShell.php @@ -92,7 +92,7 @@ class ServerShell extends AppShell { } // for windows - if (substr($this->_documentRoot, -1, 1) == DIRECTORY_SEPARATOR) { + if (substr($this->_documentRoot, -1, 1) === DIRECTORY_SEPARATOR) { $this->_documentRoot = substr($this->_documentRoot, 0, strlen($this->_documentRoot) - 1); } if (preg_match("/^([a-z]:)[\\\]+(.+)$/i", $this->_documentRoot, $m)) { diff --git a/lib/Cake/Console/Command/Task/DbConfigTask.php b/lib/Cake/Console/Command/Task/DbConfigTask.php index 7e61b568b..46af32646 100644 --- a/lib/Cake/Console/Command/Task/DbConfigTask.php +++ b/lib/Cake/Console/Command/Task/DbConfigTask.php @@ -296,7 +296,7 @@ class DbConfigTask extends AppShell { foreach ($oldConfigs as $key => $oldConfig) { foreach ($configs as $config) { - if ($oldConfig['name'] == $config['name']) { + if ($oldConfig['name'] === $config['name']) { unset($oldConfigs[$key]); } } diff --git a/lib/Cake/Console/Command/Task/ExtractTask.php b/lib/Cake/Console/Command/Task/ExtractTask.php index 8180570b5..33d1c04c7 100644 --- a/lib/Cake/Console/Command/Task/ExtractTask.php +++ b/lib/Cake/Console/Command/Task/ExtractTask.php @@ -411,7 +411,7 @@ class ExtractTask extends AppShell { $mapCount = count($map); $strings = $this->_getStrings($position, $mapCount); - if ($mapCount == count($strings)) { + if ($mapCount === count($strings)) { extract(array_combine($map, $strings)); $category = isset($category) ? $category : 6; $category = intval($category); diff --git a/lib/Cake/Console/Command/Task/ModelTask.php b/lib/Cake/Console/Command/Task/ModelTask.php index 67d2cd78d..6b517c0e8 100644 --- a/lib/Cake/Console/Command/Task/ModelTask.php +++ b/lib/Cake/Console/Command/Task/ModelTask.php @@ -611,13 +611,13 @@ class ModelTask extends BakeTask { } foreach ($tempFieldNames as $fieldName) { $assoc = false; - if ($fieldName != $model->primaryKey && $fieldName == $foreignKey) { + if ($fieldName !== $model->primaryKey && $fieldName === $foreignKey) { $assoc = array( 'alias' => $tempOtherModel->name, 'className' => $tempOtherModel->name, 'foreignKey' => $fieldName ); - } elseif ($otherTable == $model->table && $fieldName === 'parent_id') { + } elseif ($otherTable === $model->table && $fieldName === 'parent_id') { $assoc = array( 'alias' => 'Child' . $model->name, 'className' => $model->name, diff --git a/lib/Cake/Console/Command/Task/TestTask.php b/lib/Cake/Console/Command/Task/TestTask.php index a2f723e64..6efa98f65 100644 --- a/lib/Cake/Console/Command/Task/TestTask.php +++ b/lib/Cake/Console/Command/Task/TestTask.php @@ -302,7 +302,7 @@ class TestTask extends BakeTask { $position = strpos($class, $type); - if ($position !== false && strlen($class) - $position == strlen($type)) { + if ($position !== false && (strlen($class) - $position) === strlen($type)) { return $class; } return $class . $type; diff --git a/lib/Cake/Console/Command/Task/ViewTask.php b/lib/Cake/Console/Command/Task/ViewTask.php index 4a84d87d7..043610ad5 100644 --- a/lib/Cake/Console/Command/Task/ViewTask.php +++ b/lib/Cake/Console/Command/Task/ViewTask.php @@ -151,7 +151,7 @@ class ViewTask extends BakeTask { unset($methods[$i]); } } - if ($method[0] === '_' || $method == strtolower($this->controllerName . 'Controller')) { + if ($method[0] === '_' || $method === strtolower($this->controllerName . 'Controller')) { unset($methods[$i]); } } diff --git a/lib/Cake/Console/Command/UpgradeShell.php b/lib/Cake/Console/Command/UpgradeShell.php index 0169b53a0..51a39043c 100644 --- a/lib/Cake/Console/Command/UpgradeShell.php +++ b/lib/Cake/Console/Command/UpgradeShell.php @@ -581,7 +581,7 @@ class UpgradeShell extends AppShell { $new = 'View' . DS . Inflector::camelize($old); $old = 'View' . DS . $old; - if ($new == $old) { + if ($new === $old) { continue; } diff --git a/lib/Cake/Console/ConsoleInput.php b/lib/Cake/Console/ConsoleInput.php index e8af58bb0..ee2639ffd 100644 --- a/lib/Cake/Console/ConsoleInput.php +++ b/lib/Cake/Console/ConsoleInput.php @@ -47,7 +47,7 @@ class ConsoleInput { * @param string $handle The location of the stream to use as input. */ public function __construct($handle = 'php://stdin') { - $this->_canReadline = extension_loaded('readline') && $handle == 'php://stdin' ? true : false; + $this->_canReadline = extension_loaded('readline') && $handle === 'php://stdin' ? true : false; $this->_input = fopen($handle, 'r'); } diff --git a/lib/Cake/Console/Templates/default/views/form.ctp b/lib/Cake/Console/Templates/default/views/form.ctp index fa9c58315..c7cbc7b77 100644 --- a/lib/Cake/Console/Templates/default/views/form.ctp +++ b/lib/Cake/Console/Templates/default/views/form.ctp @@ -23,7 +23,7 @@ Form->input('{$field}');\n"; diff --git a/lib/Cake/Console/Templates/skel/View/Layouts/flash.ctp b/lib/Cake/Console/Templates/skel/View/Layouts/flash.ctp index 020f32d12..35e09583c 100644 --- a/lib/Cake/Console/Templates/skel/View/Layouts/flash.ctp +++ b/lib/Cake/Console/Templates/skel/View/Layouts/flash.ctp @@ -13,7 +13,7 @@ Html->charset(); ?> <?php echo $page_title; ?> - +