mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-07-31 03:10:09 +02:00
[1.7.0] Fix bug in HTMLPurifier_Harness that causes certain aspects of $input to change after parsing
- Add makeLookup() convenience function to HTMLModule - Relocate SGML exclusion comment - Add preliminary Bdo module test git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1049 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -73,12 +73,17 @@ class HTMLPurifier_Harness extends UnitTestCase
|
||||
$context->loadArray($context_array);
|
||||
|
||||
if ($this->to_tokens && is_string($input)) {
|
||||
$input = $this->lexer->tokenizeHTML($input, $config, $context);
|
||||
// $func may cause $input to change, so "clone" another copy
|
||||
// to sacrifice
|
||||
$input = $this->lexer->tokenizeHTML($s = $input, $config, $context);
|
||||
$input_c = $this->lexer->tokenizeHTML($s, $config, $context);
|
||||
} else {
|
||||
$input_c = $input;
|
||||
}
|
||||
|
||||
// call the function
|
||||
$func = $this->func;
|
||||
$result = $this->obj->$func($input, $config, $context);
|
||||
$result = $this->obj->$func($input_c, $config, $context);
|
||||
|
||||
// test a bool result
|
||||
if (is_bool($result)) {
|
||||
|
Reference in New Issue
Block a user