From 1f92edee207829a28de80ee72548cdbd599bcc79 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Wed, 22 Dec 2010 18:54:22 -0600 Subject: [PATCH] Fix fix for #6481 introduced at 7862c45ad2f32096383a21b8b301155787724476 which did not like it when Array.prototype was modified on empty arrays. --- src/ajax.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ajax.js b/src/ajax.js index da130fa..3f4f732 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. -- 1.7.10.4