Skip to content

Commit

Permalink
Catch invalid non-XML contents.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed May 19, 2014
1 parent f996a72 commit 8d1d001
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -125,7 +125,12 @@ protected function _process($domain, $tag, $types, $email)
continue;
}

$xml = new SimpleXMLElement($get->getBody());
try {
$xml = new SimpleXMLElement($get->getBody());
} catch (Exception $e) {
// No valid XML; ignore
continue;
}

foreach ($xml->emailProvider->{$tag} as $val) {
if (in_array($val['type'], $types)) {
Expand Down

0 comments on commit 8d1d001

Please sign in to comment.