[TYPO3-core] RFC: Bug 1477 and 3013 - xhtml_cleaning corrupts javascript
Martin Kutschker
Martin.Kutschker at n0spam-blackbox.net
Wed Sep 6 15:45:18 CEST 2006
Franz Holzinger schrieb:
> Hi!
>
> This is a SVN patch request.
>
> Branch: trunk / TYPO3_4-0
>
> Problem: When JavaScript is added to an extension via '$TSFE->setJS
> ($JSfieldname, $code);' then this will also go through the htmlcleaner.
> Unfortunately the HtmlCleaner modfies the JavaScript code which it
> shouldn't.
> Precisely: It considers '<' inside of JavaScript as the beginning of a
> HTML tag and htmlencodes JavaScript code.
>
> http://bugs.typo3.org/view.php?id=1477
> "HTMLcleaner wrongly cleans JavaScript" on developer list.
>
> Solution: Add an additional check for CDATA parts and do not change the
> parts inside of it any more in the main loop.
Without knowing the code of the HTML cleaner. Why look for CDATA and not
for the script element. Inside <script> nothing should be checked, wheter
enclosed by a CDATA declaration (?) or not.
Masi
More information about the TYPO3-team-core
mailing list