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
4
app/vendor/ParsedownExtra.php
vendored
4
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);
|
||||||
|
|
@ -683,4 +683,4 @@ class ParsedownExtra extends Parsedown
|
||||||
#
|
#
|
||||||
|
|
||||||
protected $regexAttribute = '(?:[#.][-\w]+[ ]*)';
|
protected $regexAttribute = '(?:[#.][-\w]+[ ]*)';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue