summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-10-05 01:24:37 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-10-05 01:24:37 +0000
commitc95229da576cfcc1e06dfa2281510921e2c7ff77 (patch)
tree63599203a4ea845d0e8877ec15dfa9bd9d245817
parentdd571ffe34ef4202a3bd95fb5a36ddbce0fb3096 (diff)
downloadbrdo-c95229da576cfcc1e06dfa2281510921e2c7ff77.tar.gz
brdo-c95229da576cfcc1e06dfa2281510921e2c7ff77.tar.bz2
#391264 by mfb and dww: Added exception handling to Update module XML parsing.
-rw-r--r--modules/update/update.fetch.inc10
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/update/update.fetch.inc b/modules/update/update.fetch.inc
index 82a078444..80d3d5352 100644
--- a/modules/update/update.fetch.inc
+++ b/modules/update/update.fetch.inc
@@ -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) {