Skip to content

Commit

Permalink
Change is_null() calls to strict checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryan Crowe committed Oct 16, 2013
1 parent bb65765 commit 39b7023
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/Cake/Model/Behavior/TreeBehavior.php
Expand Up @@ -682,7 +682,7 @@ protected function _recoverByParentId(Model $Model, $counter = 1, $parentId = nu
$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),
Expand Down Expand Up @@ -713,7 +713,7 @@ protected function _recoverByParentId(Model $Model, $counter = 1, $parentId = nu
$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)
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Network/CakeResponse.php
Expand Up @@ -570,7 +570,7 @@ public function header($header = null, $value = null) {
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);
Expand Down

0 comments on commit 39b7023

Please sign in to comment.