0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-11-09 23:28:42 +00:00

[1.4.x?] Alright, have both PHP5 and DOMDocument requirements for DOMLex checked.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@766 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang 2007-02-27 23:54:29 +00:00
parent e4bdf472a6
commit aff4957531

View File

@ -151,7 +151,8 @@ class HTMLPurifier_Lexer
$lexer = $prototype; $lexer = $prototype;
} }
if (empty($lexer)) { if (empty($lexer)) {
if (class_exists('DOMDocument')) { // check for DOM support if (version_compare(PHP_VERSION, "5", ">=") && // check for PHP5
class_exists('DOMDocument')) { // check for DOM support
require_once 'HTMLPurifier/Lexer/DOMLex.php'; require_once 'HTMLPurifier/Lexer/DOMLex.php';
$lexer = new HTMLPurifier_Lexer_DOMLex(); $lexer = new HTMLPurifier_Lexer_DOMLex();
} else { } else {