diff options
author | Mario Vavti <mario@mariovavti.com> | 2019-09-23 09:11:05 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2019-09-23 12:20:28 +0200 |
commit | e37c43ea06deabe86bd0ec572a89e5159b4b6997 (patch) | |
tree | 730d849035b445042de07674aaae8745d2daa71f /vendor/ezyang/htmlpurifier/library/HTMLPurifier/CSSDefinition.php | |
parent | 9b90114d035ce4c10ee11cd2fbffe1f5ab95af17 (diff) | |
download | volse-hubzilla-e37c43ea06deabe86bd0ec572a89e5159b4b6997.tar.gz volse-hubzilla-e37c43ea06deabe86bd0ec572a89e5159b4b6997.tar.bz2 volse-hubzilla-e37c43ea06deabe86bd0ec572a89e5159b4b6997.zip |
composer update ezyang/htmlpurifier
(cherry picked from commit a34ce790129bdd729a5019895ea6cd4c59f08ba4)
Diffstat (limited to 'vendor/ezyang/htmlpurifier/library/HTMLPurifier/CSSDefinition.php')
-rw-r--r-- | vendor/ezyang/htmlpurifier/library/HTMLPurifier/CSSDefinition.php | 52 |
1 files changed, 47 insertions, 5 deletions
diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/CSSDefinition.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/CSSDefinition.php index 47dfd1f66..21f1a5899 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/CSSDefinition.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/CSSDefinition.php @@ -220,15 +220,25 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition array( new HTMLPurifier_AttrDef_CSS_Length('0'), new HTMLPurifier_AttrDef_CSS_Percentage(true), - new HTMLPurifier_AttrDef_Enum(array('auto')) + new HTMLPurifier_AttrDef_Enum(array('auto', 'initial', 'inherit')) + ) + ); + $trusted_min_wh = new HTMLPurifier_AttrDef_CSS_Composite( + array( + new HTMLPurifier_AttrDef_CSS_Length('0'), + new HTMLPurifier_AttrDef_CSS_Percentage(true), + new HTMLPurifier_AttrDef_Enum(array('initial', 'inherit')) + ) + ); + $trusted_max_wh = new HTMLPurifier_AttrDef_CSS_Composite( + array( + new HTMLPurifier_AttrDef_CSS_Length('0'), + new HTMLPurifier_AttrDef_CSS_Percentage(true), + new HTMLPurifier_AttrDef_Enum(array('none', 'initial', 'inherit')) ) ); $max = $config->get('CSS.MaxImgLength'); - $this->info['min-width'] = - $this->info['max-width'] = - $this->info['min-height'] = - $this->info['max-height'] = $this->info['width'] = $this->info['height'] = $max === null ? @@ -245,6 +255,38 @@ class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition // For everyone else: $trusted_wh ); + $this->info['min-width'] = + $this->info['min-height'] = + $max === null ? + $trusted_min_wh : + new HTMLPurifier_AttrDef_Switch( + 'img', + // For img tags: + new HTMLPurifier_AttrDef_CSS_Composite( + array( + new HTMLPurifier_AttrDef_CSS_Length('0', $max), + new HTMLPurifier_AttrDef_Enum(array('initial', 'inherit')) + ) + ), + // For everyone else: + $trusted_min_wh + ); + $this->info['max-width'] = + $this->info['max-height'] = + $max === null ? + $trusted_max_wh : + new HTMLPurifier_AttrDef_Switch( + 'img', + // For img tags: + new HTMLPurifier_AttrDef_CSS_Composite( + array( + new HTMLPurifier_AttrDef_CSS_Length('0', $max), + new HTMLPurifier_AttrDef_Enum(array('none', 'initial', 'inherit')) + ) + ), + // For everyone else: + $trusted_max_wh + ); $this->info['text-decoration'] = new HTMLPurifier_AttrDef_CSS_TextDecoration(); |