mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Adding fix for #2488 fixes Set::extract failed on assoc array if key starts with numeric
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4900 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
3f3f86d62a
commit
698b221943
1 changed files with 4 additions and 4 deletions
|
@ -300,7 +300,7 @@ class Set extends Object {
|
|||
}
|
||||
|
||||
foreach($path as $i => $key) {
|
||||
if (intval($key) > 0 || $key == '0') {
|
||||
if (is_numeric($key) && intval($key) > 0 || $key == '0') {
|
||||
if (isset($data[intval($key)])) {
|
||||
$data = $data[intval($key)];
|
||||
} else {
|
||||
|
@ -341,7 +341,7 @@ class Set extends Object {
|
|||
$_list =& $list;
|
||||
|
||||
foreach($path as $i => $key) {
|
||||
if (intval($key) > 0 || $key == '0') {
|
||||
if (is_numeric($key) && intval($key) > 0 || $key == '0') {
|
||||
$key = intval($key);
|
||||
}
|
||||
if ($i == count($path) - 1) {
|
||||
|
@ -374,7 +374,7 @@ class Set extends Object {
|
|||
$_list =& $list;
|
||||
|
||||
foreach($path as $i => $key) {
|
||||
if (intval($key) > 0 || $key == '0') {
|
||||
if (is_numeric($key) && intval($key) > 0 || $key == '0') {
|
||||
$key = intval($key);
|
||||
}
|
||||
if ($i == count($path) - 1) {
|
||||
|
@ -411,7 +411,7 @@ class Set extends Object {
|
|||
}
|
||||
|
||||
foreach($path as $i => $key) {
|
||||
if (intval($key) > 0 || $key == '0') {
|
||||
if (is_numeric($key) && intval($key) > 0 || $key == '0') {
|
||||
$key = intval($key);
|
||||
}
|
||||
if ($i == count($path) - 1) {
|
||||
|
|
Loading…
Add table
Reference in a new issue