Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed! ticket #989, Set::extract replacing first index with an index …

…of same key [0] one step lower
  • Loading branch information...
commit 7812223eb5876b8a7fbbf3a54d62c5397eec9193 1 parent 33afe21
@torifat torifat authored
Showing with 7 additions and 7 deletions.
  1. +7 −7 cake/libs/set.php
View
14 cake/libs/set.php
@@ -431,6 +431,13 @@ function extract($path, $data = null, $options = array()) {
'key' => $key,
'item' => array_keys($context['item']),
);
+ } elseif (($key === $token || (ctype_digit($token) && $key == $token) || $token === '.')) {
+ $context['trace'][] = $key;
+ $matches[] = array(
+ 'trace' => $context['trace'],
+ 'key' => $key,
+ 'item' => $context['item'],
+ );
} elseif (is_array($context['item']) && array_key_exists($token, $context['item'])) {
$items = $context['item'][$token];
if (!is_array($items)) {
@@ -470,13 +477,6 @@ function extract($path, $data = null, $options = array()) {
'item' => $item,
);
}
- } elseif (($key === $token || (ctype_digit($token) && $key == $token) || $token === '.')) {
- $context['trace'][] = $key;
- $matches[] = array(
- 'trace' => $context['trace'],
- 'key' => $key,
- 'item' => $context['item'],
- );
}
}
if ($conditions) {
Please sign in to comment.
Something went wrong with that request. Please try again.