evalScript rcleanScript replacement fails in IE8
|Reported by:||Owned by:|
In evalScript the use of the rcleanScript RegExp to wrap XML Comments/CDATA tags with a multiline comment fails because Internet Explorer 8 does not support the $0 backreference. This is actually correct behavior, as the ECMAScript specification explicitly states that n has a non-zero value; the $0 backreference is probably included in most implementations by convention.
'abc'.replace(/a/, '($0)'); // '($0)bc' 'abc'.replace(/a/, '($&)'); // '(a)bc'
The end result is that given an inline script:
the eval'd string looks like:
/*$0*/ ... -->
which bombs when it encounters the XML comment end (as the start is missing).
As a workaround you can insert a single-line comment before the end-comment tag in your inline script:
so your eval'd script looks like:
/*$0*/ ... //-->
Change History (13)
comment:5 Changed 5 years ago by
|Component:||core → ajax|
|Milestone:||None → 1.8|
|Priority:||low → high|
|Status:||reopened → open|