From d91e3ea8c64a788e317875818306c7247783011c Mon Sep 17 00:00:00 2001 From: Daijobou Date: Sun, 29 Apr 2018 19:07:14 +0200 Subject: [PATCH] More CSS selector options Source https://www.w3schools.com/cssref/css_selectors.asp Missing :lang(language) :not(selector) :nth-child(n) :nth-last-child(n) :nth-last-of-type(n) :nth-of-type(n) --- .../Filter/ExtractStyleBlocks.php | 32 +++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/library/HTMLPurifier/Filter/ExtractStyleBlocks.php b/library/HTMLPurifier/Filter/ExtractStyleBlocks.php index 66f70b0fc..02f3183b6 100644 --- a/library/HTMLPurifier/Filter/ExtractStyleBlocks.php +++ b/library/HTMLPurifier/Filter/ExtractStyleBlocks.php @@ -62,12 +62,38 @@ public function __construct() $this->_class_attrdef = new HTMLPurifier_AttrDef_CSS_Ident(); $this->_enum_attrdef = new HTMLPurifier_AttrDef_Enum( array( + 'active', + 'after', + 'before', + 'checked', + 'disabled', + 'empty', + 'enabled', 'first-child', + 'first-letter', + 'first-line', + 'first-of-type', + 'focus', + 'hover', + 'in-range', + 'invalid', + 'last-child', + 'last-of-type', 'link', + 'nth-child(odd)', + 'nth-child(even)', + 'only-of-type', + 'only-child', + 'optional', + 'out-of-range', + 'read-only', + 'read-write', + 'required', + 'root', + 'selection', + 'target', + 'valid', 'visited', - 'active', - 'hover', - 'focus' ) ); }