Skip to content
Snippets Groups Projects
Commit c95229da authored by Angie Byron's avatar Angie Byron
Browse files

#391264 by mfb and dww: Added exception handling to Update module XML parsing.

parent dd571ffe
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -189,7 +189,15 @@ function _update_cron_notify() {
function update_parse_xml($raw_xml_list) {
$data = array();
foreach ($raw_xml_list as $raw_xml) {
$xml = new SimpleXMLElement($raw_xml);
try {
$xml = new SimpleXMLElement($raw_xml);
}
catch (Exception $e) {
// SimpleXMLElement::__construct produces an E_WARNING error message for
// each error found in the XML data and throws an exception if errors
// were detected. Catch any exception and break to the next XML string.
break;
}
$short_name = (string)$xml->short_name;
$data[$short_name] = array();
foreach ($xml as $k => $v) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment