0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-01-03 13:21:51 +00:00

Merge pull request #94 from zobzn/css-min-max-width

css definition (min-width, max-width, min-height, max-height)
This commit is contained in:
Edward Z. Yang 2016-09-05 14:57:44 -07:00 committed by GitHub
commit 6a221a3045
3 changed files with 11 additions and 0 deletions

View File

@ -15,6 +15,9 @@
"require": {
"php": ">=5.2"
},
"require-dev": {
"simpletest/simpletest": "^1.1"
},
"autoload": {
"psr-0": { "HTMLPurifier": "library/" },
"files": ["library/HTMLPurifier.composer.php"]

View File

@ -225,6 +225,10 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
);
$max = $config->get('CSS.MaxImgLength');
$this->info['min-width'] =
$this->info['max-width'] =
$this->info['min-height'] =
$this->info['max-height'] =
$this->info['width'] =
$this->info['height'] =
$max === null ?

View File

@ -61,6 +61,10 @@ class HTMLPurifier_AttrDef_CSSTest extends HTMLPurifier_AttrDefHarness
$this->assertDef('width:50px;');
$this->assertDef('width:auto;');
$this->assertDef('width:-50px;', false);
$this->assertDef('min-width:50%;');
$this->assertDef('min-width:50px;');
$this->assertDef('min-width:auto;');
$this->assertDef('min-width:-50px;', false);
$this->assertDef('text-decoration:underline;');
$this->assertDef('font-family:sans-serif;');
$this->assertDef("font-family:Gill, 'Times New Roman', sans-serif;");