diff --git a/NEWS b/NEWS index d5b82b55..950cac9b 100644 --- a/NEWS +++ b/NEWS @@ -9,11 +9,9 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier . Internal change ========================== -2.2.0, unknown release date -[ no items ] - 2.1.1, unknown release date - Fix show-stopper bug in %URI.MakeAbsolute functionality +- Fix PHP4 syntax error in standalone version . Add prefix directory to include path for standalone, this prevents other installations from clobbering the standalone's URI schemes . Single test methods can be invoked by prefixing with __only diff --git a/library/HTMLPurifier.php b/library/HTMLPurifier.php index 18aeb9ca..69e8acfc 100644 --- a/library/HTMLPurifier.php +++ b/library/HTMLPurifier.php @@ -205,7 +205,7 @@ class HTMLPurifier if (is_a($prototype, 'HTMLPurifier')) { $htmlpurifier = $prototype; } elseif ($prototype) { - $htmlpurifier = new HTMLPurifier(HTMLPurifier_Config::create($prototype)); + $htmlpurifier = new HTMLPurifier($prototype); } else { $htmlpurifier = new HTMLPurifier(); } diff --git a/maintenance/merge-library.php b/maintenance/merge-library.php index 9ce23e0f..46c3c891 100755 --- a/maintenance/merge-library.php +++ b/maintenance/merge-library.php @@ -167,6 +167,10 @@ function make_file_standalone($file) { */ function replace_includes_callback($matches) { $file = $matches[1]; + // PHP 5 only file + if ($file == 'HTMLPurifier/Lexer/DOMLex.php') { + return $matches[0]; + } if (isset($GLOBALS['loaded'][$file])) return ''; $GLOBALS['loaded'][$file] = true; create_blank($file); @@ -195,5 +199,9 @@ make_dir_standalone('HTMLPurifier/Language'); make_file_standalone('HTMLPurifier/Printer/ConfigForm.js'); make_file_standalone('HTMLPurifier/Printer/ConfigForm.css'); make_dir_standalone('HTMLPurifier/URIScheme'); +// PHP 5 only file +mkdir_deep('standalone/HTMLPurifier/Lexer'); +make_file_standalone('HTMLPurifier/Lexer/DOMLex.php'); +make_file_standalone('HTMLPurifier/TokenFactory.php'); echo ' done!' . PHP_EOL; diff --git a/tests/HTMLPurifierTest.php b/tests/HTMLPurifierTest.php index 1c5bcd76..3ad307bb 100644 --- a/tests/HTMLPurifierTest.php +++ b/tests/HTMLPurifierTest.php @@ -133,8 +133,8 @@ alert(""); } function testGetInstance() { - $purifier = HTMLPurifier::getInstance(); - $purifier2 = HTMLPurifier::getInstance(); + $purifier =& HTMLPurifier::getInstance(); + $purifier2 =& HTMLPurifier::getInstance(); $this->assertReference($purifier, $purifier2); }