Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#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 Timmy Willison

Component: unfiledattributes
Milestone: None1.7.1
Priority: undecidedlow
Status: newopen
Version: 1.7

I'd call #1 invalid.

The change is simple enough tho: third party pull.

comment:2 Changed 12 years ago by dmethvin

Owner: set to dmethvin
Status: openassigned

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 Oleg

Resolution: fixed
Status: assignedclosed

Fix #10773. Improve parameter handling in removeAttr.

Changeset: a467aa0a779b8741581cc2ab1fcd914f5718f5c8

Note: See TracTickets for help on using tickets.