Fix #7472 and added test for #3113

- Forms with an input that has either name="action" or name="some-other-attr-on-the-form" caused problems in IE6/7.  This is fixed.

- Changed check in $.attr for ret === null to typeof ret === "object" to catch any inputs that are accidentally retrieved in IE6/7, since attributes cannot be set to objects and typeof null === "object"
This commit is contained in:
timmywil 2011-03-25 00:35:50 -04:00
parent 11cfdb2394
commit 102053abd8
3 changed files with 8 additions and 4 deletions

View file

@ -320,7 +320,8 @@ jQuery.extend({
ret = elem.getAttribute( name );
// Non-existent attributes return null, we normalize to undefined
return ret === null || ret === "null" ?
// Instead of checking for null, we check for typeof object to catch inputs in IE6/7. Bug #7472
return typeof ret === "object" || ret === "null" ?
undefined :
ret;
}