diff --git a/NEWS b/NEWS index 12f2e189..2313d9e0 100644 --- a/NEWS +++ b/NEWS @@ -36,6 +36,7 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier - Improved adherence to Unicode by checking for non-character codepoints. Thanks Geoffrey Sneddon for reporting. This may result in degraded performance for extremely large inputs. +- Allow CSS property-value pair ''text-decoration: none'' . Added HTMLPurifier_UnitConverter and HTMLPurifier_Length for convenient handling of CSS-style lengths. HTMLPurifier_AttrDef_CSS_Length now uses this class. diff --git a/TODO b/TODO index abb3e36b..40b1125f 100644 --- a/TODO +++ b/TODO @@ -19,7 +19,6 @@ afraid to cast your vote for the next feature to be implemented! - Built-in support for target="_blank" on all external links - Make Phorum hide emails - Implement SecureMunge for resources too -- Fix text-decoration:none bug - Gitify the repository FUTURE VERSIONS diff --git a/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php b/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php index 2108f804..af16d591 100644 --- a/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php +++ b/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php @@ -13,10 +13,13 @@ class HTMLPurifier_AttrDef_CSS_TextDecoration extends HTMLPurifier_AttrDef static $allowed_values = array( 'line-through' => true, 'overline' => true, - 'underline' => true + 'underline' => true, ); $string = strtolower($this->parseCDATA($string)); + + if ($string === 'none') return $string; + $parts = explode(' ', $string); $final = ''; foreach ($parts as $part) { diff --git a/tests/HTMLPurifier/AttrDef/CSS/TextDecorationTest.php b/tests/HTMLPurifier/AttrDef/CSS/TextDecorationTest.php index 30e42a63..2709d3a2 100644 --- a/tests/HTMLPurifier/AttrDef/CSS/TextDecorationTest.php +++ b/tests/HTMLPurifier/AttrDef/CSS/TextDecorationTest.php @@ -7,6 +7,9 @@ class HTMLPurifier_AttrDef_CSS_TextDecorationTest extends HTMLPurifier_AttrDefHa $this->def = new HTMLPurifier_AttrDef_CSS_TextDecoration(); + $this->assertDef('none'); + $this->assertDef('none underline', 'underline'); + $this->assertDef('underline'); $this->assertDef('overline'); $this->assertDef('line-through overline underline');