mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-12-22 16:31:53 +00:00
[1.7.0] Lexer is now pre-emptively included, with a conditional include for the PHP5 only version.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1090 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
parent
e180b7689e
commit
7a3e06d4d0
2
NEWS
2
NEWS
@ -30,6 +30,8 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier
|
|||||||
. Add extra protection in AttrDef_URI against phantom Schemes
|
. Add extra protection in AttrDef_URI against phantom Schemes
|
||||||
. Doctype object added to HTMLDefinition which describes certain aspects
|
. Doctype object added to HTMLDefinition which describes certain aspects
|
||||||
of the operational document type
|
of the operational document type
|
||||||
|
. Lexer is now pre-emptively included, with a conditional include for the
|
||||||
|
PHP5 only version.
|
||||||
|
|
||||||
1.6.1, released 2007-05-05
|
1.6.1, released 2007-05-05
|
||||||
! Support for more deprecated attributes via transformations:
|
! Support for more deprecated attributes via transformations:
|
||||||
|
@ -4,6 +4,14 @@ require_once 'HTMLPurifier/Token.php';
|
|||||||
require_once 'HTMLPurifier/Encoder.php';
|
require_once 'HTMLPurifier/Encoder.php';
|
||||||
require_once 'HTMLPurifier/EntityParser.php';
|
require_once 'HTMLPurifier/EntityParser.php';
|
||||||
|
|
||||||
|
// implementations
|
||||||
|
require_once 'HTMLPurifier/Lexer/DirectLex.php';
|
||||||
|
if (version_compare(PHP_VERSION, "5", ">=")) {
|
||||||
|
// You can remove the if statement if you are running PHP 5 only.
|
||||||
|
// We ought to get the strict version to follow those rules.
|
||||||
|
require_once 'HTMLPurifier/Lexer/DOMLex.php';
|
||||||
|
}
|
||||||
|
|
||||||
HTMLPurifier_ConfigSchema::define(
|
HTMLPurifier_ConfigSchema::define(
|
||||||
'Core', 'AcceptFullDocuments', true, 'bool',
|
'Core', 'AcceptFullDocuments', true, 'bool',
|
||||||
'This parameter determines whether or not the filter should accept full '.
|
'This parameter determines whether or not the filter should accept full '.
|
||||||
@ -153,10 +161,8 @@ class HTMLPurifier_Lexer
|
|||||||
if (empty($lexer)) {
|
if (empty($lexer)) {
|
||||||
if (version_compare(PHP_VERSION, "5", ">=") && // check for PHP5
|
if (version_compare(PHP_VERSION, "5", ">=") && // check for PHP5
|
||||||
class_exists('DOMDocument')) { // check for DOM support
|
class_exists('DOMDocument')) { // check for DOM support
|
||||||
require_once 'HTMLPurifier/Lexer/DOMLex.php';
|
|
||||||
$lexer = new HTMLPurifier_Lexer_DOMLex();
|
$lexer = new HTMLPurifier_Lexer_DOMLex();
|
||||||
} else {
|
} else {
|
||||||
require_once 'HTMLPurifier/Lexer/DirectLex.php';
|
|
||||||
$lexer = new HTMLPurifier_Lexer_DirectLex();
|
$lexer = new HTMLPurifier_Lexer_DirectLex();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user