aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ajax.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ajax.js b/src/ajax.js
index da130faed..3f4f732bd 100644
--- a/src/ajax.js
+++ b/src/ajax.js
@@ -343,7 +343,9 @@ function buildParams( prefix, obj, traditional, add ) {
});
} else if ( !traditional && obj != null && typeof obj === "object" ) {
- if ( jQuery.isEmptyObject( obj ) ) {
+ // If we see an array here, it is empty and should be treated as an empty
+ // object
+ if ( jQuery.isArray( obj ) || jQuery.isEmptyObject( obj ) ) {
add( prefix, "" );
// Serialize object item.