diff options
Diffstat (limited to 'plugins/RssWidget')
-rw-r--r-- | plugins/RssWidget/RssRenderer.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/RssWidget/RssRenderer.php b/plugins/RssWidget/RssRenderer.php index ca00fb7730..d512585fc6 100644 --- a/plugins/RssWidget/RssRenderer.php +++ b/plugins/RssWidget/RssRenderer.php @@ -56,7 +56,11 @@ class RssRenderer if (!$output) { try { $content = Http::fetchRemoteFile($this->url); - $rss = simplexml_load_string($content); + + $rss = @simplexml_load_string($content); + if ($rss === false) { + throw new \Exception("Failed to parse XML."); + } } catch (\Exception $e) { throw new \Exception("Error while importing feed: {$e->getMessage()}\n"); } |