[TYPO3-core] FYI48: #12899: Wrong usage of CDATA raise javascript error

Oliver Klee typo3-german-02 at oliverklee.de
Thu Dec 3 12:39:50 CET 2009


Hi,

Ernesto Baschny [cron IT] schrieb:
> Which browser will rise this error? Commenting it out the way you did
> it: won't this make it non-xhtml anymore?

No, because the part in the script tag will not be considered to be HTML
anymore.

> As far as I researched, the best way to escape the cdata without caring
> about "legacy browser" that don't interpret javascript at all is:
> 
> starting line: <!--//--><![CDATA[
> ending line: //]]>

Won't <!-- be invalid JavaScript?

I have the best experiences with Steffen's solution in my extension
because this makes all HTML and JavaScript warnings disappear (and also
is fully valid the way I read it).

This solution isn't mentioned in the sitepoint discussion at all, so
they don't say that this solution is invalid. :-)


Oliver
-- 
Certified TYPO3 Integrator | TYPO3 Security Team Member


More information about the TYPO3-team-core mailing list