mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-01-03 05:11:52 +00:00
Color keywords now case-insensitive.
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
This commit is contained in:
parent
f1439f0af5
commit
f51a6f7de9
4
NEWS
4
NEWS
@ -9,6 +9,10 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier
|
|||||||
. Internal change
|
. Internal change
|
||||||
==========================
|
==========================
|
||||||
|
|
||||||
|
4.3.1, unknown release date
|
||||||
|
- Color keywords are now case insensitive. Thanks Yzmir Ramirez
|
||||||
|
<yramirez-htmlpurifier@adicio.com> for reporting.
|
||||||
|
|
||||||
4.3.0, released 2011-03-27
|
4.3.0, released 2011-03-27
|
||||||
# Fixed broken caching of customized raw definitions, but requires an
|
# Fixed broken caching of customized raw definitions, but requires an
|
||||||
API change. The old API still works but will emit a warning,
|
API change. The old API still works but will emit a warning,
|
||||||
|
@ -14,7 +14,7 @@ class HTMLPurifier_AttrDef_HTML_Color extends HTMLPurifier_AttrDef
|
|||||||
$string = trim($string);
|
$string = trim($string);
|
||||||
|
|
||||||
if (empty($string)) return false;
|
if (empty($string)) return false;
|
||||||
if (isset($colors[$string])) return $colors[$string];
|
if (isset($colors[strtolower($string)])) return $colors[$string];
|
||||||
if ($string[0] === '#') $hex = substr($string, 1);
|
if ($string[0] === '#') $hex = substr($string, 1);
|
||||||
else $hex = $string;
|
else $hex = $string;
|
||||||
|
|
||||||
|
@ -24,5 +24,6 @@ array (
|
|||||||
--DESCRIPTION--
|
--DESCRIPTION--
|
||||||
|
|
||||||
Lookup array of color names to six digit hexadecimal number corresponding
|
Lookup array of color names to six digit hexadecimal number corresponding
|
||||||
to color, with preceding hash mark. Used when parsing colors.
|
to color, with preceding hash mark. Used when parsing colors. The lookup
|
||||||
|
is done in a case-insensitive manner.
|
||||||
--# vim: et sw=4 sts=4
|
--# vim: et sw=4 sts=4
|
||||||
|
Loading…
Reference in New Issue
Block a user