Bug Tracker

Ticket #10773 (closed bug: fixed)

Opened 3 years ago

Last modified 2 years ago

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:
Blocking: Blocked by:

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

comment:1 Changed 3 years ago by timmywil

  • Priority changed from undecided to low
  • Status changed from new to open
  • Version set to 1.7
  • Component changed from unfiled to attributes
  • Milestone changed from None to 1.7.1

I'd call #1 invalid.

The change is simple enough tho:  third party pull.

comment:2 Changed 3 years ago by dmethvin

  • Owner set to dmethvin
  • Status changed from open to 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 3 years ago by Oleg

  • Status changed from assigned to closed
  • Resolution set to fixed

Fix #10773. Improve parameter handling in removeAttr.

Changeset: a467aa0a779b8741581cc2ab1fcd914f5718f5c8

Note: See TracTickets for help on using tickets.