0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-12-22 16:31:53 +00:00

Make PHP5 lexer default DOMLex.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@84 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang 2006-07-22 15:07:53 +00:00
parent 5bcb3c60cd
commit 9180d6256f

View File

@ -21,8 +21,13 @@ class HTMLPurifier_Lexer
$lexer = $prototype;
}
if (empty($lexer)) {
require_once 'HTMLPurifier/Lexer/DirectLex.php';
$lexer = new HTMLPurifier_Lexer_DirectLex();
if (version_compare(PHP_VERSION, '5', '>=')) {
require_once 'HTMLPurifier/Lexer/DOMLex.php';
$lexer = new HTMLPurifier_Lexer_DOMLex();
} else {
require_once 'HTMLPurifier/Lexer/DirectLex.php';
$lexer = new HTMLPurifier_Lexer_DirectLex();
}
}
return $lexer;
}