Bug Tracker

Ticket #194 (closed bug: fixed)

Opened 2 years ago

Last modified 1 year ago

Fix for attribute *=, ^=, and $= in cases where special attributes.

Reported by: bjmiller@… Assigned to: anonymous
Type: bug Priority: major
Milestone: 1.0 Component: core
Version: 1.0 Keywords: attribute
Cc: Needs:

Description

In FF 1.5, selecting attribute @name where the name attribute is not present results in a "z has no properties" error, because z, which should be "" when the attribute is not present, has a value of null.

Attachments

Change History

Changed 2 years ago by anonymous

This has solved the problem:

Change jQuery.expr."@" from

"@": {
	"=": "z==m[4]",
	"!=": "z!=m[4]",
	"^=": "!z.indexOf(m[4])",
	"$=": "z.substr(z.length - m[4].length,m[4].length)==m[4]",
	"*=": "z.indexOf(m[4])>=0",
	"": "z"
},

to

"@": {
	"=": "z==m[4]",
	"!=": "z!=m[4]",
	"^=": "z && !z.indexOf(m[4])",
	"$=": "z && z.substr(z.length - m[4].length,m[4].length)==m[4]",
	"*=": "z && z.indexOf(m[4])>=0",
	"": "z"
},

We're just testing for null before we try to call the indexOf() or substr() methods that we expect from strings.

Changed 2 years ago by bjmiller@…

  • version set to 1.0
  • milestone set to 1.0

Changed 2 years ago by joern

  • status changed from new to closed
  • resolution set to fixed

Fixed in SVN.

Note: See TracTickets for help on using tickets.