From 8166e33e7f003fe1a0a37e5d62341777686f0ff3 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Thu, 10 Aug 2017 13:20:32 +0200 Subject: [PATCH] [FeedExpander] Remove whitespace from source content Whitespace at the beginning of feeds causes parsing errors. This is an example using an ill-formatted RSS feed: "XML or text declaration not at start of entity" -- https://validator.w3.org This commit automatically removes all proceeding and trailing white- space from the source content before resume parsing. --- lib/FeedExpander.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/FeedExpander.php b/lib/FeedExpander.php index ff209495..5dbb0bba 100644 --- a/lib/FeedExpander.php +++ b/lib/FeedExpander.php @@ -18,7 +18,7 @@ abstract class FeedExpander extends BridgeAbstract { */ $content = getContents($url) or returnServerError('Could not request ' . $url); - $rssContent = simplexml_load_string($content); + $rssContent = simplexml_load_string(trim($content)); debugMessage('Detecting feed format/version'); switch(true) {