mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-03-11 17:18:44 +00:00
Fix a few errors that came with API change. I really should run the unit tests before committing.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@213 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
parent
a2880bdff2
commit
ebe01a0a24
@ -11,7 +11,7 @@ class HTMLPurifier_AttrDef_Length extends HTMLPurifier_AttrDef_Pixels
|
||||
$string = trim($string);
|
||||
if ($string === '') return false;
|
||||
|
||||
$parent_result = parent::validate($string);
|
||||
$parent_result = parent::validate($string, $config, $context);
|
||||
if ($parent_result !== false) return $parent_result;
|
||||
|
||||
$length = strlen($string);
|
||||
|
@ -11,7 +11,7 @@ class HTMLPurifier_AttrDef_MultiLength extends HTMLPurifier_AttrDef_Length
|
||||
$string = trim($string);
|
||||
if ($string === '') return false;
|
||||
|
||||
$parent_result = parent::validate($string);
|
||||
$parent_result = parent::validate($string, $config, $context);
|
||||
if ($parent_result !== false) return $parent_result;
|
||||
|
||||
$length = strlen($string);
|
||||
|
@ -175,6 +175,12 @@ class HTMLPurifier_AttrDef_URITest extends HTMLPurifier_AttrDefHarness
|
||||
if (!isset($expect_uri[$i])) {
|
||||
$expect_uri[$i] = $value;
|
||||
}
|
||||
if (!isset($config[$i])) {
|
||||
$config[$i] = HTMLPurifier_Config::createDefault();
|
||||
}
|
||||
if (!isset($context[$i])) {
|
||||
$context[$i] = new HTMLPurifier_AttrContext();
|
||||
}
|
||||
if ($components[$i] === false) {
|
||||
$scheme->expectNever('validateComponents');
|
||||
} else {
|
||||
@ -182,7 +188,7 @@ class HTMLPurifier_AttrDef_URITest extends HTMLPurifier_AttrDefHarness
|
||||
'validateComponents', $return_components[$i], $components[$i]);
|
||||
$scheme->expectOnce('validateComponents', $components[$i]);
|
||||
}
|
||||
$result = $def->validate($value);
|
||||
$result = $def->validate($value, $config[$i], $context[$i]);
|
||||
$scheme->tally();
|
||||
$this->assertIdentical($expect_uri[$i], $result, "Test $i: %s");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user