mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-12-22 16:31:53 +00:00
Update DOMLex.php
Also fixed another instance of "undefined property" error.
This commit is contained in:
parent
fb8ad91cac
commit
f4fdd55ad2
@ -194,7 +194,7 @@ class HTMLPurifier_Lexer_DOMLex extends HTMLPurifier_Lexer
|
|||||||
} elseif ($node->nodeType === XML_CDATA_SECTION_NODE) {
|
} elseif ($node->nodeType === XML_CDATA_SECTION_NODE) {
|
||||||
// undo libxml's special treatment of <script> and <style> tags
|
// undo libxml's special treatment of <script> and <style> tags
|
||||||
$last = end($tokens);
|
$last = end($tokens);
|
||||||
$data = $node->data;
|
$data = $node->data ?? "";
|
||||||
// (note $node->tagname is already normalized)
|
// (note $node->tagname is already normalized)
|
||||||
if ($last instanceof HTMLPurifier_Token_Start && ($last->name == 'script' || $last->name == 'style')) {
|
if ($last instanceof HTMLPurifier_Token_Start && ($last->name == 'script' || $last->name == 'style')) {
|
||||||
$new_data = trim($data);
|
$new_data = trim($data);
|
||||||
|
Loading…
Reference in New Issue
Block a user