[TYPO3-core] RFC: Bug #9217: typo3ajax::renderAsXML does not always render XML

Martin Kutschker masi-no at spam-typo3.org
Mon Aug 25 14:42:24 CEST 2008


Francois Suter schrieb:
> Hi,
> 
>> But I fail to see the point of this. Shouldn't be the code around this
>> call be responsible for ensuring that the XML is proper?
>>
>> It looks to me that this is only needed for debugging. So maybe you can
>> turn on "validation" by a switch.
> 
> When I first discussed this bug with Benni I was of the mind to just
> call t3lib_div::array2xml($this->content) and be done with it, since
> this was IMO the expected behavior of the typo3ajax::renderAsXML() method.
> 
> Benni thought that some people may be using this method with already
> formed XML (as it is the only way to use it in its currently buggy
> state) and may be surprised at the change of behaviour, hence the check
> (for backward-compatibility reasons).

Still the expensive check is not justified (see below).

> I wonder if this class is really used to render as XML and I would be
> all in favour of not having this test. On the other it could be a
> feature, if people wanted to have a more finely crafted XML than what is
> produced by t3lib_div::array2xml().

OK, so the class has currently an array that will be auto-converted to
XML via t3lib_div::array2xml? Now you want to support manually crafted XML?

Why not only test if $this->content is an array or a string. If it's the
 former it will be passed trough t3lib_div::array2xml if it's the latter
it will be sent as-is. Anything else throws an exception or returns FALSE.

I don't like the fact that $this->contain may contain different data
types but your patches do the same.

Masi


More information about the TYPO3-team-core mailing list