Skip to content

Commit

Permalink
Fix for PHP >= 5.4 and Libxml >= 2.7.8
Browse files Browse the repository at this point in the history
The previous version could break some markup with new PHP and Libxml
versions. For details, see https://stackoverflow.com/a/22490902
  • Loading branch information
tmoravec committed Oct 11, 2017
1 parent 0db5cce commit 6ce5c07
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ParsedownExtra.php
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,7 @@ protected function processTag($elementMarkup) # recursive
$elementMarkup = mb_convert_encoding($elementMarkup, 'HTML-ENTITIES', 'UTF-8');

# http://stackoverflow.com/q/4879946/200145
$DOMDocument->loadHTML($elementMarkup);
$DOMDocument->removeChild($DOMDocument->doctype);
$DOMDocument->replaceChild($DOMDocument->firstChild->firstChild->firstChild, $DOMDocument->firstChild);
$DOMDocument->loadHTML($elementMarkup, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);

$elementText = '';

Expand Down

1 comment on commit 6ce5c07

@amorphine
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tadeas thanks for the patch, seems like the author does not support his code anymore and this area crashes October CMS mail system.

Please # to comment.