mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-02 12:21:09 +02: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:
@@ -11,7 +11,7 @@ class HTMLPurifier_AttrDef_Length extends HTMLPurifier_AttrDef_Pixels
|
|||||||
$string = trim($string);
|
$string = trim($string);
|
||||||
if ($string === '') return false;
|
if ($string === '') return false;
|
||||||
|
|
||||||
$parent_result = parent::validate($string);
|
$parent_result = parent::validate($string, $config, $context);
|
||||||
if ($parent_result !== false) return $parent_result;
|
if ($parent_result !== false) return $parent_result;
|
||||||
|
|
||||||
$length = strlen($string);
|
$length = strlen($string);
|
||||||
|
@@ -11,7 +11,7 @@ class HTMLPurifier_AttrDef_MultiLength extends HTMLPurifier_AttrDef_Length
|
|||||||
$string = trim($string);
|
$string = trim($string);
|
||||||
if ($string === '') return false;
|
if ($string === '') return false;
|
||||||
|
|
||||||
$parent_result = parent::validate($string);
|
$parent_result = parent::validate($string, $config, $context);
|
||||||
if ($parent_result !== false) return $parent_result;
|
if ($parent_result !== false) return $parent_result;
|
||||||
|
|
||||||
$length = strlen($string);
|
$length = strlen($string);
|
||||||
|
@@ -175,6 +175,12 @@ class HTMLPurifier_AttrDef_URITest extends HTMLPurifier_AttrDefHarness
|
|||||||
if (!isset($expect_uri[$i])) {
|
if (!isset($expect_uri[$i])) {
|
||||||
$expect_uri[$i] = $value;
|
$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) {
|
if ($components[$i] === false) {
|
||||||
$scheme->expectNever('validateComponents');
|
$scheme->expectNever('validateComponents');
|
||||||
} else {
|
} else {
|
||||||
@@ -182,7 +188,7 @@ class HTMLPurifier_AttrDef_URITest extends HTMLPurifier_AttrDefHarness
|
|||||||
'validateComponents', $return_components[$i], $components[$i]);
|
'validateComponents', $return_components[$i], $components[$i]);
|
||||||
$scheme->expectOnce('validateComponents', $components[$i]);
|
$scheme->expectOnce('validateComponents', $components[$i]);
|
||||||
}
|
}
|
||||||
$result = $def->validate($value);
|
$result = $def->validate($value, $config[$i], $context[$i]);
|
||||||
$scheme->tally();
|
$scheme->tally();
|
||||||
$this->assertIdentical($expect_uri[$i], $result, "Test $i: %s");
|
$this->assertIdentical($expect_uri[$i], $result, "Test $i: %s");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user