Skip to content

Commit

Permalink
fix: Ignore HTML errors when creating tickets from emails
Browse files Browse the repository at this point in the history
I had an error because an email contained a tag `<o:p>` (the `o`
namespace wasn't defined). The fetching was failing quite badly because
of this error.

I think we should just ignore this kind of errors as they are produced
by bad HTML. It should be ok since we sanitize the HTML later.
  • Loading branch information
marien-probesys committed Jan 29, 2024
1 parent b9917f0 commit f0dc217
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ private function replaceAttachmentsUrls(string $content, array $messageDocuments
'UTF-8'
);

$contentDom->loadHTML($content);
$contentDom->loadHTML($content, \LIBXML_NOERROR);
$contentDomXPath = new \DomXPath($contentDom);

foreach ($messageDocuments as $attachmentId => $messageDocument) {
Expand Down

0 comments on commit f0dc217

Please sign in to comment.