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

Ernesto Baschny [cron IT] ernst at cron-it.de
Thu Dec 3 12:25:41 CET 2009

Steffen Kamper schrieb:

> This is an SVN patch request.
> Type: bugfix
> BT reference: http://bugs.typo3.org/view.php?id=12899
> Branches: trunk, 4_3
> in t3lib_tsStyleConfig::ext_getForm the CDATA is
> * not commented out which raise a javascript error
> * have wrong closing tag
> This javascript tag is used in EM with info view of extension.

Which browser will rise this error? Commenting it out the way you did
it: won't this make it non-xhtml 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: //]]>

See [1] for a "full explanation". As soon as we find the "best way" to
handle this, we should add this to the CGL so that everybody knows how
to do it. Or even better instead of adding the escaping every time, call
the API function t3lib_div::wrapJS() and we can then later centrally
adapt it to our needs.


[1] http://www.sitepoint.com/forums/showthread.php?p=1955911

More information about the TYPO3-team-core mailing list