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:
phpnut 2007-04-29 01:47:26 +00:00
parent 3f3f86d62a
commit 698b221943

View file

@ -300,7 +300,7 @@ class Set extends Object {
} }
foreach($path as $i => $key) { 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)])) { if (isset($data[intval($key)])) {
$data = $data[intval($key)]; $data = $data[intval($key)];
} else { } else {
@ -341,7 +341,7 @@ class Set extends Object {
$_list =& $list; $_list =& $list;
foreach($path as $i => $key) { foreach($path as $i => $key) {
if (intval($key) > 0 || $key == '0') { if (is_numeric($key) && intval($key) > 0 || $key == '0') {
$key = intval($key); $key = intval($key);
} }
if ($i == count($path) - 1) { if ($i == count($path) - 1) {
@ -374,7 +374,7 @@ class Set extends Object {
$_list =& $list; $_list =& $list;
foreach($path as $i => $key) { foreach($path as $i => $key) {
if (intval($key) > 0 || $key == '0') { if (is_numeric($key) && intval($key) > 0 || $key == '0') {
$key = intval($key); $key = intval($key);
} }
if ($i == count($path) - 1) { if ($i == count($path) - 1) {
@ -411,7 +411,7 @@ class Set extends Object {
} }
foreach($path as $i => $key) { foreach($path as $i => $key) {
if (intval($key) > 0 || $key == '0') { if (is_numeric($key) && intval($key) > 0 || $key == '0') {
$key = intval($key); $key = intval($key);
} }
if ($i == count($path) - 1) { if ($i == count($path) - 1) {