From 5c0a1d467aef55cfba96b782a099fe87b7f32528 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Sat, 16 Feb 2008 05:44:14 +0000 Subject: [PATCH] [3.1.0] [BACKPORT] Fix bug with trusted script handling for versions of libxml 2.6.28 or later git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1553 48356398-32a2-884e-a903-53898d9a118a --- NEWS | 1 + library/HTMLPurifier/Lexer/DOMLex.php | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 4039d3d5..f14dbf92 100644 --- a/NEWS +++ b/NEWS @@ -31,6 +31,7 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier - Various HTMLPurifier_Config convenience functions now accept another parameter $schema which defines what HTMLPurifier_ConfigSchema to use besides the global default. +- Fix bug with trusted script handling in libxml versions later than 2.6.28. . Plugins now get their own changelogs according to project conventions. . Convert tokens to use instanceof, reducing memory footprint and improving comparison speed. diff --git a/library/HTMLPurifier/Lexer/DOMLex.php b/library/HTMLPurifier/Lexer/DOMLex.php index cd1e5526..ed4101c8 100644 --- a/library/HTMLPurifier/Lexer/DOMLex.php +++ b/library/HTMLPurifier/Lexer/DOMLex.php @@ -87,10 +87,27 @@ class HTMLPurifier_Lexer_DOMLex extends HTMLPurifier_Lexer $tokens[] = $this->factory->createText($node->data); return; } elseif ($node->nodeType === XML_CDATA_SECTION_NODE) { - // undo DOM's special treatment of