Skip to content

Commit

Permalink
Wrapped loadXML method within a try-catch and return false instead of…
Browse files Browse the repository at this point in the history
… throwing an error.
  • Loading branch information
Fredrik Sundblom committed Apr 22, 2021
1 parent f30f506 commit d92a64b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Saml2/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ public static function loadXML(DOMDocument $dom, $xml)
$oldEntityLoader = libxml_disable_entity_loader(true);
}

$res = $dom->loadXML($xml);
try {
$res = $dom->loadXML($xml);
} catch (\Exception $e) {
return false;
}

if (PHP_VERSION_ID < 80000) {
libxml_disable_entity_loader($oldEntityLoader);
Expand Down

0 comments on commit d92a64b

Please sign in to comment.