#10773 closed bug (fixed)
removeAttr is fragile for edge cases
Reported by: | markel | Owned by: | dmethvin |
---|---|---|---|
Priority: | low | Milestone: | 1.7.1 |
Component: | attributes | Version: | 1.7 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
If argument for removeAttr is:
1) not a string( http://jsfiddle.net/G4wfm/ ),
2) empty string ( http://jsfiddle.net/G4wfm/1/ ),
3) nothing ( http://jsfiddle.net/G4wfm/3/ ),
4) string with additional space in the end ( http://jsfiddle.net/G4wfm/2/ ).
Than it produces a error.
Last one also exist for toggleClass(), addClass() and removeClass(). But for them its just a needless loop iteration.
Change History (3)
comment:1 Changed 12 years ago by
Component: | unfiled → attributes |
---|---|
Milestone: | None → 1.7.1 |
Priority: | undecided → low |
Status: | new → open |
Version: | → 1.7 |
comment:2 Changed 12 years ago by
Owner: | set to dmethvin |
---|---|
Status: | open → assigned |
In general we don't want to start down the road of parameter paranoia, so I wouldn't land this if that was the only reason. It does solve a few other issues and doesn't take a lot of bytes so I'm ok with it.
comment:3 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fix #10773. Improve parameter handling in removeAttr.
Changeset: a467aa0a779b8741581cc2ab1fcd914f5718f5c8
I'd call #1 invalid.
The change is simple enough tho: third party pull.