From 698b2219431ec5470c8bcd4685ac13944153635f Mon Sep 17 00:00:00 2001 From: phpnut Date: Sun, 29 Apr 2007 01:47:26 +0000 Subject: [PATCH] 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 --- cake/libs/set.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cake/libs/set.php b/cake/libs/set.php index e1cf52d68..82e66608a 100644 --- a/cake/libs/set.php +++ b/cake/libs/set.php @@ -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) {