mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
Fixing extraction of non-zero arrays with only one element and attribute selectors. Fixes #475
This commit is contained in:
parent
cbb65ca85f
commit
4f4d3f9ffe
2 changed files with 4 additions and 3 deletions
|
@ -438,7 +438,8 @@ class Set extends Object {
|
|||
$items = array($items);
|
||||
} elseif (!isset($items[0])) {
|
||||
$current = current($items);
|
||||
if ((is_array($current) && count($items) <= 1) || !is_array($current)) {
|
||||
$currentKey = key($items);
|
||||
if (!is_array($current) || (is_array($current) && count($items) <= 1 && !is_numeric($currentKey))) {
|
||||
$items = array($items);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue