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

[3.0.0] Allow filter:none for proprietary filter property

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1474 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang 2007-12-17 22:12:11 +00:00
parent 0f961c6af4
commit ae1c8f47cc
2 changed files with 3 additions and 0 deletions

View File

@ -19,6 +19,7 @@ class HTMLPurifier_AttrDef_CSS_Filter extends HTMLPurifier_AttrDef
public function validate($value, $config, &$context) {
$value = $this->parseCDATA($value);
if ($value === 'none') return $value;
// if we looped this we could support multiple filters
$function_length = strcspn($value, '(');
$function = trim(substr($value, 0, $function_length));

View File

@ -10,6 +10,8 @@ class HTMLPurifier_AttrDef_CSS_FilterTest extends HTMLPurifier_AttrDefHarness
$this->def = new HTMLPurifier_AttrDef_CSS_Filter();
$this->assertDef('none');
$this->assertDef('alpha(opacity=0)');
$this->assertDef('alpha(opacity=100)');
$this->assertDef('alpha(opacity=50)');