From f2a1d53eccabc32a92d29de9560ad8ebba2e2891 Mon Sep 17 00:00:00 2001
From: megachriz <megachriz@654114.no-reply.drupal.org>
Date: Thu, 5 May 2016 11:09:15 +0200
Subject: [PATCH] Issue #2704171 by MegaChriz: Fixed parse RSS feeds that
 contain additional whitespace.

---
 libraries/common_syndication_parser.inc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libraries/common_syndication_parser.inc b/libraries/common_syndication_parser.inc
index a0c1e319..a4d373e5 100644
--- a/libraries/common_syndication_parser.inc
+++ b/libraries/common_syndication_parser.inc
@@ -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.
-- 
GitLab