Strict checks where applicable.

This commit is contained in:
euromark 2013-10-08 20:16:55 +02:00
parent 02acf636a7
commit eb852a0247
4 changed files with 5 additions and 5 deletions

View file

@ -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)

View file

@ -1849,7 +1849,7 @@ class Model extends Object implements CakeEventListener {
}
foreach ((array)$data as $row) {
if ((is_string($row) && (strlen($row) == 36 || strlen($row) == 16)) || is_numeric($row)) {
if ((is_string($row) && (strlen($row) === 36 || strlen($row) === 16)) || is_numeric($row)) {
$newJoins[] = $row;
$values = array($id, $row);
if ($isUUID && $primaryAdded) {

View file

@ -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);

View file

@ -1038,7 +1038,7 @@ class Router {
}
$addition = http_build_query($q, null, $join);
if ($out && $addition && substr($out, strlen($join) * -1, strlen($join)) != $join) {
if ($out && $addition && substr($out, strlen($join) * -1, strlen($join)) !== $join) {
$out .= $join;
}