Update ParsedownExtra to use mb_encode_numericentity for safer HTML
encoding
This commit is contained in:
parent
7b5d07a88d
commit
0901d6324c
1 changed files with 2 additions and 2 deletions
2
app/vendor/ParsedownExtra.php
vendored
2
app/vendor/ParsedownExtra.php
vendored
|
|
@ -625,7 +625,7 @@ class ParsedownExtra extends Parsedown
|
||||||
$DOMDocument = new DOMDocument;
|
$DOMDocument = new DOMDocument;
|
||||||
|
|
||||||
# http://stackoverflow.com/q/11309194/200145
|
# http://stackoverflow.com/q/11309194/200145
|
||||||
$elementMarkup = mb_convert_encoding($elementMarkup, 'HTML-ENTITIES', 'UTF-8');
|
$elementMarkup = mb_encode_numericentity($elementMarkup, [0x80, 0x10FFFF, 0, ~0], 'UTF-8');
|
||||||
|
|
||||||
# http://stackoverflow.com/q/4879946/200145
|
# http://stackoverflow.com/q/4879946/200145
|
||||||
$DOMDocument->loadHTML($elementMarkup);
|
$DOMDocument->loadHTML($elementMarkup);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue