1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-31 19:30:21 +02:00

Fix mungeRgb to handle percent, float and hsl values

This commit is contained in:
f.godfrin
2017-02-10 00:38:05 +01:00
parent bd92f3531b
commit 0bab4b9fd0
2 changed files with 17 additions and 6 deletions

View File

@@ -12,12 +12,18 @@ class HTMLPurifier_AttrDef_CSS_BackgroundTest extends HTMLPurifier_AttrDefHarnes
$this->assertDef($valid);
$this->assertDef('url(\'chess.png\') #333 50% top repeat fixed', $valid);
$this->assertDef(
'rgb(34, 56, 33) url(chess.png) repeat fixed top',
'rgb(34,56,33) url("chess.png") repeat fixed top'
'rgb(34%, 56%, 33%) url(chess.png) repeat fixed top',
'rgb(34%,56%,33%) url("chess.png") repeat fixed top'
);
$this->assertDef(
'rgba(74, 12, 85, 0.35) repeat fixed bottom',
'rgba(74,12,85,.35) repeat fixed bottom'
);
$this->assertDef(
'hsl(244, 47.4%, 88.1%) right center',
'hsl(244,47.4%,88.1%) right center'
);
}
}
// vim: et sw=4 sts=4