fix: give better error message when feed can't be parsed (#2618)

This commit is contained in:
dag 2022-04-10 18:54:32 +02:00 committed by GitHub
parent c3a106892d
commit dbee47f1d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -95,6 +95,10 @@ abstract class FeedExpander extends BridgeAbstract {
or returnServerError('Could not request ' . $url); or returnServerError('Could not request ' . $url);
$rssContent = simplexml_load_string(trim($content)); $rssContent = simplexml_load_string(trim($content));
if ($rssContent === false) {
throw new \Exception('Unable to parse string as xml');
}
Debug::log('Detecting feed format/version'); Debug::log('Detecting feed format/version');
switch(true) { switch(true) {
case isset($rssContent->item[0]): case isset($rssContent->item[0]):