0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-12-22 16:31:53 +00:00

[3.1.1] Fix text-decoration: none bug

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1799 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang 2008-06-17 03:12:50 +00:00
parent 41830cd902
commit 643ed1bddc
4 changed files with 8 additions and 2 deletions

1
NEWS
View File

@ -36,6 +36,7 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier
- Improved adherence to Unicode by checking for non-character codepoints. - Improved adherence to Unicode by checking for non-character codepoints.
Thanks Geoffrey Sneddon for reporting. This may result in degraded Thanks Geoffrey Sneddon for reporting. This may result in degraded
performance for extremely large inputs. performance for extremely large inputs.
- Allow CSS property-value pair ''text-decoration: none''
. Added HTMLPurifier_UnitConverter and HTMLPurifier_Length for convenient . Added HTMLPurifier_UnitConverter and HTMLPurifier_Length for convenient
handling of CSS-style lengths. HTMLPurifier_AttrDef_CSS_Length now uses handling of CSS-style lengths. HTMLPurifier_AttrDef_CSS_Length now uses
this class. this class.

1
TODO
View File

@ -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 - Built-in support for target="_blank" on all external links
- Make Phorum hide emails - Make Phorum hide emails
- Implement SecureMunge for resources too - Implement SecureMunge for resources too
- Fix text-decoration:none bug
- Gitify the repository - Gitify the repository
FUTURE VERSIONS FUTURE VERSIONS

View File

@ -13,10 +13,13 @@ class HTMLPurifier_AttrDef_CSS_TextDecoration extends HTMLPurifier_AttrDef
static $allowed_values = array( static $allowed_values = array(
'line-through' => true, 'line-through' => true,
'overline' => true, 'overline' => true,
'underline' => true 'underline' => true,
); );
$string = strtolower($this->parseCDATA($string)); $string = strtolower($this->parseCDATA($string));
if ($string === 'none') return $string;
$parts = explode(' ', $string); $parts = explode(' ', $string);
$final = ''; $final = '';
foreach ($parts as $part) { foreach ($parts as $part) {

View File

@ -7,6 +7,9 @@ class HTMLPurifier_AttrDef_CSS_TextDecorationTest extends HTMLPurifier_AttrDefHa
$this->def = new HTMLPurifier_AttrDef_CSS_TextDecoration(); $this->def = new HTMLPurifier_AttrDef_CSS_TextDecoration();
$this->assertDef('none');
$this->assertDef('none underline', 'underline');
$this->assertDef('underline'); $this->assertDef('underline');
$this->assertDef('overline'); $this->assertDef('overline');
$this->assertDef('line-through overline underline'); $this->assertDef('line-through overline underline');