From 39b7023e756d8e7c84ca4de387a21271183d4695 Mon Sep 17 00:00:00 2001 From: Bryan Crowe Date: Tue, 15 Oct 2013 22:32:46 -0400 Subject: [PATCH 1/2] Change is_null() calls to strict checks --- lib/Cake/Model/Behavior/TreeBehavior.php | 4 ++-- lib/Cake/Network/CakeResponse.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Cake/Model/Behavior/TreeBehavior.php b/lib/Cake/Model/Behavior/TreeBehavior.php index e87abedc3..94c2bb443 100644 --- a/lib/Cake/Model/Behavior/TreeBehavior.php +++ b/lib/Cake/Model/Behavior/TreeBehavior.php @@ -682,7 +682,7 @@ class TreeBehavior extends ModelBehavior { $children = $Model->find('all', $params); $hasChildren = (bool)$children; - if (!is_null($parentId)) { + if ($parentId !== null) { if ($hasChildren) { $Model->updateAll( array($this->settings[$Model->alias]['left'] => $counter), @@ -713,7 +713,7 @@ class TreeBehavior extends ModelBehavior { $children = $Model->find('all', $params); } - if (!is_null($parentId) && $hasChildren) { + if ($parentId !== null && $hasChildren) { $Model->updateAll( array($this->settings[$Model->alias]['right'] => $counter), array($Model->escapeField() => $parentId) diff --git a/lib/Cake/Network/CakeResponse.php b/lib/Cake/Network/CakeResponse.php index 3db176327..bcda4266f 100644 --- a/lib/Cake/Network/CakeResponse.php +++ b/lib/Cake/Network/CakeResponse.php @@ -570,7 +570,7 @@ class CakeResponse { if (is_numeric($header)) { list($header, $value) = array($value, null); } - if (is_null($value)) { + if ($value === null) { list($header, $value) = explode(':', $header, 2); } $this->_headers[$header] = is_array($value) ? array_map('trim', $value) : trim($value); From 5addb2cc9f7d7a6ea7812f4df1e285c09a7fbc56 Mon Sep 17 00:00:00 2001 From: Bryan Crowe Date: Tue, 15 Oct 2013 22:53:04 -0400 Subject: [PATCH 2/2] Change is_null() calls to strict checks in CakeSchema::_arrayDiffAssoc() --- lib/Cake/Model/CakeSchema.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Model/CakeSchema.php b/lib/Cake/Model/CakeSchema.php index a860108fb..6c4079e65 100644 --- a/lib/Cake/Model/CakeSchema.php +++ b/lib/Cake/Model/CakeSchema.php @@ -551,7 +551,7 @@ class CakeSchema extends Object { continue; } $correspondingValue = $array2[$key]; - if (is_null($value) !== is_null($correspondingValue)) { + if (($value === null ) !== ($correspondingValue === null)) { $difference[$key] = $value; continue; }