[TYPO3-core] RFC: enable CDATA creation in t3lib_div::xml2array()

Martin Kutschker martin.kutschker-n0spam at no5pam-blackbox.net
Sat Jan 27 17:38:18 CET 2007


Ingmar Schlecht schrieb:
> Hi Dmitry,
> 
> Dmitry Dulepov wrote:
>> This is SVN patch request.
>>
>> Branch: trunk (for 4.1!)
>>
>> Problem: if there are large block of HTML that should go to XML crated
>> by t3lib_div::xml2array(), all < and > will be converted to &lt; and
>> &gt; thus making later manual editing very inconvenient.
>>
>> Solution: enable CDATA usage in xml2array through options. If option is
>> not specified, behavior does not change. array2xml parses CDATA perfectly.
>>
>> This patch is mainly made to simplify life for templavoila users, who
>> often ask for it. It is pretty simple.
> 
> 1.) What if $v itself contains the string "]]>"? Is there any standard
> conforming way to escape that?

No. It's simply not allowed and the standard describes no way how to 
deal with such a situation, though it declares the nesting of CDATA 
sections as forbidden.

MSDN has only a tip for script developers: when you need "]]>" you may 
often write "] ]>".

I think we can ignore the situation and add to the function specs that 
$useCDATA forbids the character sequences <![CDATA[ and ]]>.

Masi


More information about the TYPO3-team-core mailing list