Skip to content

Commit 0df59ad

Browse files
committed
Fix Hash type casting
As merged in cakephp#3288
1 parent 0c4d369 commit 0df59ad

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/Cake/Utility/Hash.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,13 @@ protected static function _matches(array $data, $selector) {
192192
return false;
193193
}
194194

195-
$prop = isset($data[$attr]) ? $data[$attr] : null;
195+
$prop = null;
196+
if (isset($data[$attr])) {
197+
$prop = $data[$attr];
198+
}
199+
if ($prop === true || $prop === false) {
200+
$prop = $prop ? 'true' : 'false';
201+
}
196202

197203
// Pattern matches and other operators.
198204
if ($op === '=' && $val && $val[0] === '/') {

0 commit comments

Comments
 (0)