summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2013-08-04 23:37:20 -0400
committerDavid Rothstein <drothstein@gmail.com>2013-08-04 23:37:20 -0400
commitd6f960c6d04f2a2a8c43a39e5aa76673d89fac9d (patch)
treebae1eb116eff34c2cf2e47fb26554eba1357f668 /includes/common.inc
parent9988e47d6d4f0c0f858af424d23bc6825c550b19 (diff)
downloadbrdo-d6f960c6d04f2a2a8c43a39e5aa76673d89fac9d.tar.gz
brdo-d6f960c6d04f2a2a8c43a39e5aa76673d89fac9d.tar.bz2
Issue #1575060 followup by SebCorbin, andypost: Second attempt to fix broken ajax_html_ids for forms with file element (encoding=multipart/form-data).
Diffstat (limited to 'includes/common.inc')
-rw-r--r--includes/common.inc10
1 files changed, 5 insertions, 5 deletions
diff --git a/includes/common.inc b/includes/common.inc
index a18cbc545..d2a36be2b 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -3888,14 +3888,14 @@ function drupal_html_id($id) {
// requested id. $_POST['ajax_html_ids'] contains the ids as they were
// returned by this function, potentially with the appended counter, so
// we parse that to reconstruct the $seen_ids array.
- if (is_array($_POST['ajax_html_ids'])) {
+ if (isset($_POST['ajax_html_ids'][0]) && strpos($_POST['ajax_html_ids'][0], ',') === FALSE) {
$ajax_html_ids = $_POST['ajax_html_ids'];
}
else {
- // jquery.form.js may send the server a comma-separated string instead
- // of an array (see http://drupal.org/node/1575060), so we need to
- // convert it to an array in that case.
- $ajax_html_ids = explode(',', $_POST['ajax_html_ids']);
+ // jquery.form.js may send the server a comma-separated string as the
+ // first element of an array (see http://drupal.org/node/1575060), so
+ // we need to convert it to an array in that case.
+ $ajax_html_ids = explode(',', $_POST['ajax_html_ids'][0]);
}
foreach ($ajax_html_ids as $seen_id) {
// We rely on '--' being used solely for separating a base id from the