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

[2.1.1] Fix syntax error in standalone library

- fix faulty PHP4 test
- remove unnecessary HTMLPurifier_Config::create() call

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1365 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang 2007-08-05 01:15:23 +00:00
parent c3efafb07d
commit 4f92c0377f
4 changed files with 12 additions and 6 deletions

4
NEWS
View File

@ -9,11 +9,9 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier
. Internal change . Internal change
========================== ==========================
2.2.0, unknown release date
[ no items ]
2.1.1, unknown release date 2.1.1, unknown release date
- Fix show-stopper bug in %URI.MakeAbsolute functionality - 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 . Add prefix directory to include path for standalone, this prevents
other installations from clobbering the standalone's URI schemes other installations from clobbering the standalone's URI schemes
. Single test methods can be invoked by prefixing with __only . Single test methods can be invoked by prefixing with __only

View File

@ -205,7 +205,7 @@ class HTMLPurifier
if (is_a($prototype, 'HTMLPurifier')) { if (is_a($prototype, 'HTMLPurifier')) {
$htmlpurifier = $prototype; $htmlpurifier = $prototype;
} elseif ($prototype) { } elseif ($prototype) {
$htmlpurifier = new HTMLPurifier(HTMLPurifier_Config::create($prototype)); $htmlpurifier = new HTMLPurifier($prototype);
} else { } else {
$htmlpurifier = new HTMLPurifier(); $htmlpurifier = new HTMLPurifier();
} }

View File

@ -167,6 +167,10 @@ function make_file_standalone($file) {
*/ */
function replace_includes_callback($matches) { function replace_includes_callback($matches) {
$file = $matches[1]; $file = $matches[1];
// PHP 5 only file
if ($file == 'HTMLPurifier/Lexer/DOMLex.php') {
return $matches[0];
}
if (isset($GLOBALS['loaded'][$file])) return ''; if (isset($GLOBALS['loaded'][$file])) return '';
$GLOBALS['loaded'][$file] = true; $GLOBALS['loaded'][$file] = true;
create_blank($file); 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.js');
make_file_standalone('HTMLPurifier/Printer/ConfigForm.css'); make_file_standalone('HTMLPurifier/Printer/ConfigForm.css');
make_dir_standalone('HTMLPurifier/URIScheme'); 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; echo ' done!' . PHP_EOL;

View File

@ -133,8 +133,8 @@ alert("<This is compatible with XHTML>");
} }
function testGetInstance() { function testGetInstance() {
$purifier = HTMLPurifier::getInstance(); $purifier =& HTMLPurifier::getInstance();
$purifier2 = HTMLPurifier::getInstance(); $purifier2 =& HTMLPurifier::getInstance();
$this->assertReference($purifier, $purifier2); $this->assertReference($purifier, $purifier2);
} }