AzuraCast/nowplaying

SimpleXMLElement::simplexml_load_string fails on illegal char

Vaalyn opened this issue · 2 comments

As mentioned in this issue for AzuraCast it is possible that the XML response from IceCast contains an illegal character which leads to a failure to decode the response via the simplexml_load_string function.

In the issue mentioned above this illegal character gets send by a faulty streaming software to IceCast but regardless of what is sending this illegal char to IceCast since IceCast itself has no problem with the char and happily returns an XML containing it this library should be able to deal with cases like this. It could make sense to switch from using simplexml to something like sabre/xml which uses the DOM API which is much more robust than simplexml.

@Vaalyn sabre/xml is a cool library but it seems to be a bit much for what we're doing. I wonder if there's something halfway between the two...something that will more loosely allow traversal/parsing of XML trees but won't just flop on illegal characters.

@SlvrEagle23 If sabre/xml is too much then maybe something like imangazaliev/didom could be more suited. It still uses the DOM to parse XML so should be as resilient as sabre/xml.