Bug Tracker

Opened 12 years ago

Closed 12 years ago

#2035 closed bug (wontfix)

"clean" RegExp fails in Safari 412

Reported by: ajpotts Owned by:
Priority: major Milestone: 1.2.4
Component: core Version: 1.2.1
Keywords: Cc:
Blocked by: Blocking:

Description (last modified by brandon)

This line

elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){...

will fail in Safari 2.0 build 412 (and presumably before). Safari doesn't see the end of the regex at all, and so pretty much everything goes wrong.

Quick fix:

elem = elem.replace(new RegExp("(<(\w+)[^>]*?)\/>"), function(all, front, tag){ ...

Obviously early Safari has a problem with parsing RegExps in the /.../g style, but I haven't found any other problems yet.

Attachments (1)

2035.diff (564 bytes) - added by ebartels 12 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 12 years ago by ajpotts

Sorry, didn't spot the browser compatibility change to 2.0.2.

For what it's worth, 2.0 test suite errors are largely confined to unicode selectors. Still, this fix is valid for anyone who cares. Allows thickbox amongst others to work fine.

comment:2 Changed 12 years ago by brandon

Description: modified (diff)

Changed 12 years ago by ebartels

Attachment: 2035.diff added

comment:3 Changed 12 years ago by ebartels

This seems to fix a lot of Safari 2 issues with appending/inserting content.

comment:4 Changed 12 years ago by flesler

Milestone: 1.2.21.2.4
Resolution: wontfix
Status: newclosed

That is a very old version of Safari.. and not supported.

There's no point in fixing this, that kind of regexps take more time to process, and that function is called a lot.

Closing as invalid.

Note: See TracTickets for help on using tickets.