Skip to content
Snippets Groups Projects
Commit f2a1d53e authored by megachriz's avatar megachriz Committed by MegaChriz
Browse files

Issue #2704171 by MegaChriz: Fixed parse RSS feeds that contain additional whitespace.

parent 11697a53
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,10 @@
* stdClass The structured datas extracted from the feed.
*/
function common_syndication_parser_parse($string) {
// SimpleXML can only deal with XML declaration at the start of the document,
// so remove any surrounding whitespace.
$string = trim($string);
@ $xml = simplexml_load_string($string, NULL, LIBXML_NOERROR | LIBXML_NOWARNING | LIBXML_NOCDATA);
// Got a malformed XML.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment