Skip to main content

Bug Tracker

Side navigation

#10773 closed bug (fixed)

Opened November 13, 2011 08:10AM UTC

Closed November 14, 2011 04:32PM UTC

Last modified March 08, 2012 07:09PM UTC

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.

Attachments (0)
Change History (3)

Changed November 13, 2011 07:38PM UTC by timmywil comment:1

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.

Changed November 14, 2011 04:13PM UTC by dmethvin comment:2

owner: → 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.

Changed November 14, 2011 04:32PM UTC by Oleg comment:3

resolution: → fixed
status: assignedclosed

Fix #10773. Improve parameter handling in removeAttr.

Changeset: a467aa0a779b8741581cc2ab1fcd914f5718f5c8