mirror of
https://github.com/jquery/jquery.git
synced 2026-02-01 09:44:56 -05:00
Serialize: Fix object detection
jQuery.type doesn't just return "null" for null but also e.g. "array" for arrays instead of object so it's not really a typeof analogue. My suggestion was stupid. Sorry. (cherry-picked from14c0fe4432) Refs3d7ce0a65f
This commit is contained in:
@@ -28,7 +28,7 @@ function buildParams( prefix, obj, traditional, add ) {
|
||||
|
||||
// Item is non-scalar (array or object), encode its numeric index.
|
||||
buildParams(
|
||||
prefix + "[" + ( jQuery.type( v ) === "object" ? i : "" ) + "]",
|
||||
prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
|
||||
v,
|
||||
traditional,
|
||||
add
|
||||
|
||||
Reference in New Issue
Block a user