Skip to content

Commit

Permalink
Make sure to restore the error handler
Browse files Browse the repository at this point in the history
Even when the thrown exception is caught, the error handler should be restored
  • Loading branch information
tacovandenbroek authored and alexdebril committed Jun 4, 2021
1 parent 1db8a9b commit 4f691b6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/FeedIo/Reader/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,12 @@ function ($errno, $errstr) {
}
);

$domDocument = new \DOMDocument();
$domDocument->loadXML($this->content);
restore_error_handler();
try {
$domDocument = new \DOMDocument();
$domDocument->loadXML($this->content);
} finally {
restore_error_handler();
}

return $domDocument;
}
Expand Down

0 comments on commit 4f691b6

Please sign in to comment.