1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-04 21:28:06 +02:00

Detect if domxml extension is loaded, and use DirectLex accordingly.

Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
This commit is contained in:
Edward Z. Yang
2008-10-08 17:06:10 -04:00
parent f7bc0b0875
commit d304c5c976
3 changed files with 25 additions and 3 deletions

View File

@@ -93,9 +93,15 @@ class HTMLPurifier_Lexer
break;
}
if (class_exists('DOMDocument') && method_exists('DOMDocument', 'loadHTML')) {
// check for DOM support, because, surprisingly enough,
// it's *not* part of the core!
if (
class_exists('DOMDocument') &&
method_exists('DOMDocument', 'loadHTML') &&
!extension_loaded('domxml')
) {
// check for DOM support, because while it's part of the
// core, it can be disabled compile time. Also, the PECL
// domxml extension overrides the default DOM, and is evil
// and nasty and we shan't bother to support it
$lexer = 'DOMLex';
} else {
$lexer = 'DirectLex';