Fux #2006 allow some aspect-ratio values and all valid object-fit values in HTML filter

This commit is contained in:
Kijin Sung 2022-10-29 21:23:39 +09:00
parent bf54cd8ceb
commit a44959382e
2 changed files with 16 additions and 0 deletions

View file

@ -441,6 +441,14 @@ class HTMLFilter
$info['resize'] = new \HTMLPurifier_AttrDef_Enum(array(
'none', 'both', 'horizontal', 'vertical', 'initial', 'inherit',
));
$info['aspect-ratio'] = new \HTMLPurifier_AttrDef_CSS_Composite(array(
new \HTMLPurifier_AttrDef_CSS_Number(),
new \HTMLPurifier_AttrDef_Enum(array('2/1', '16/9', '4/3', '1/1', '3/4', '9/16', '1/2')),
new \HTMLPurifier_AttrDef_Enum(array('auto', 'initial', 'inherit')),
));
$info['object-fit'] = new \HTMLPurifier_AttrDef_Enum(array(
'contain', 'cover', 'fill', 'none', 'scale-down', 'initial', 'inherit',
));
// Wrap all new properties with a decorator that handles !important.
$allow_important = $config->get('CSS.AllowImportant');