0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-09-19 18:55:19 +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:
Edward Z. Yang 2006-08-12 16:12:16 +00:00
parent a2880bdff2
commit ebe01a0a24
3 changed files with 9 additions and 3 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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");