From d8bb73ce469391028d3e98bbcb4af8bcb1c078db Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Fri, 27 Jul 2012 18:28:29 -0400 Subject: [PATCH] Permit underscores in font-families. Signed-off-by: Edward Z. Yang --- NEWS | 1 + library/HTMLPurifier/AttrDef/CSS/FontFamily.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 38a3031a..f2de80ba 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,7 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier but this may break some clients. ! Support display:inline-block ! Support for more white-space CSS values. +! Permit underscores in font families - Use prepend for SPL autoloading on PHP 5.3 and later. - Fix bug with nofollow transform when pre-existing rel exists. - Fix bug where background:url() always gets lower-cased diff --git a/library/HTMLPurifier/AttrDef/CSS/FontFamily.php b/library/HTMLPurifier/AttrDef/CSS/FontFamily.php index 0d9a4e12..98dcf820 100644 --- a/library/HTMLPurifier/AttrDef/CSS/FontFamily.php +++ b/library/HTMLPurifier/AttrDef/CSS/FontFamily.php @@ -9,7 +9,7 @@ class HTMLPurifier_AttrDef_CSS_FontFamily extends HTMLPurifier_AttrDef protected $mask = null; public function __construct() { - $this->mask = '- '; + $this->mask = '_- '; for ($c = 'a'; $c <= 'z'; $c++) $this->mask .= $c; for ($c = 'A'; $c <= 'Z'; $c++) $this->mask .= $c; for ($c = '0'; $c <= '9'; $c++) $this->mask .= $c; // cast-y, but should be fine @@ -165,7 +165,7 @@ class HTMLPurifier_AttrDef_CSS_FontFamily extends HTMLPurifier_AttrDef // extensive research, we may feel comfortable with dropping // it down to edgy. - // Edgy: alphanumeric, spaces, dashes and Unicode. Use of + // Edgy: alphanumeric, spaces, dashes, underscores and Unicode. Use of // str(c)spn assumes that the string was already well formed // Unicode (which of course it is). if (strspn($font, $this->mask) !== strlen($font)) { -- 2.11.4.GIT