Ok, this should actually fix #6041 :)

This commit is contained in:
Ben Alman 2010-02-06 10:43:10 +08:00 committed by John Resig
parent 8a66a30fec
commit 3c5b1ca03b
2 changed files with 3 additions and 3 deletions

View file

@ -624,7 +624,7 @@ jQuery.extend({
// If traditional, encode the "old" way (the way 1.3.2 or older
// did it), otherwise encode params recursively.
for ( var prefix in a ) {
buildParams( traditional ? prefix : prefix.replace(/[\[\]]/g, ""), a[prefix] );
buildParams( prefix, a[prefix] );
}
}
@ -635,7 +635,7 @@ jQuery.extend({
if ( jQuery.isArray(obj) ) {
// Serialize array item.
jQuery.each( obj, function( i, v ) {
if ( traditional ) {
if ( traditional || /\[\]$/.test( prefix ) ) {
// Treat each array item as a scalar.
add( prefix, v );
} else {