This commit is contained in:
Dag 2023-10-13 01:02:19 +02:00 committed by GitHub
parent 44fb2c98bc
commit e379019db2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 72 additions and 57 deletions

View file

@ -6,7 +6,10 @@ final class FeedParser
{
public function parseFeed(string $xmlString): array
{
libxml_use_internal_errors(true);
$xml = simplexml_load_string(trim($xmlString));
$xmlErrors = libxml_get_errors();
libxml_use_internal_errors(false);
if ($xml === false) {
throw new \Exception('Unable to parse xml');
}