summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-11-15 10:06:32 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-11-15 10:06:32 +0000
commit9c05cdef9ece6e84eddf73aad096cc84cd903b2d (patch)
tree3bfa37c77dcfd660fc3cf3555a8d7ff14d6c6bfa /includes
parentee7495b7c0c57fcd2b73aaf23a14f8c8efaee29d (diff)
downloadbrdo-9c05cdef9ece6e84eddf73aad096cc84cd903b2d.tar.gz
brdo-9c05cdef9ece6e84eddf73aad096cc84cd903b2d.tar.bz2
#953914 by chx, yched, effulgentsia, pifantastic: Fixed #limit_validation_errors fails is parents array contains numeric indexes.
Diffstat (limited to 'includes')
-rw-r--r--includes/form.inc6
1 files changed, 4 insertions, 2 deletions
diff --git a/includes/form.inc b/includes/form.inc
index 15c18cbda..02f82725e 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -1446,8 +1446,10 @@ function form_set_error($name = NULL, $message = '', $limit_validation_errors =
// reconstructed #parents begin with the same keys as the specified
// section, then the element's values are within the part of
// $form_state['values'] that the clicked button requires to be valid,
- // so errors for this element must be recorded.
- if (array_slice(explode('][', $name), 0, count($section)) === $section) {
+ // so errors for this element must be recorded. As the exploded array
+ // will all be strings, we need to cast every value of the section
+ // array to string.
+ if (explode('][', $name, count($section)) === array_map('strval', $section)) {
$record = TRUE;
break;
}