]> source.dussan.org Git - redmine.git/commitdiff
Merged r22025 from trunk to 5.0-stable (#38073).
authorGo MAEDA <maeda@farend.jp>
Mon, 16 Jan 2023 12:57:42 +0000 (12:57 +0000)
committerGo MAEDA <maeda@farend.jp>
Mon, 16 Jan 2023 12:57:42 +0000 (12:57 +0000)
git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@22048 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/wiki_formatting/common_mark/sanitization_filter.rb
test/unit/lib/redmine/wiki_formatting/common_mark/sanitization_filter_test.rb

index adb301290c60ba8a451f90ab273fe688fedb8939..54e0db4cbc115e5b929dc05151b17e0524aae084 100644 (file)
@@ -29,8 +29,8 @@ module Redmine
 
         ALLOWED_CSS_PROPERTIES = %w[
           color background-color
-          width
-          height
+          width min-width max-width
+          height min-height max-height
           padding padding-left padding-right padding-top padding-bottom
           margin margin-left margin-right margin-top margin-bottom
           border border-left border-right border-top border-bottom border-radius border-style border-collapse border-spacing
index 8de671cc688338f246aef059cb9b977d324c23af..e3ac4bd33f1848e1111b7845a9acd0820bfb2279 100644 (file)
@@ -97,6 +97,10 @@ if Object.const_defined?(:CommonMarker)
         '<span style="color: #333; background: url(\'https://example.com/evil.svg\')">hello</span>"',
         '<span style="color: #333; ">hello</span>"'
       ],
+      [
+        '<img src="photo.jpg" style="min-width: 100px; max-width: 200px; min-height: 100px; max-height: 200px;">',
+        '<img src="photo.jpg" style="min-width: 100px; max-width: 200px; min-height: 100px; max-height: 200px;">'
+      ],
       [
         '<b>Lo<!-- comment -->rem</b> <a href="pants" title="foo" style="text-decoration: underline;">ipsum</a> <a href="http://foo.com/"><strong>dolor</strong></a> sit<br/>amet <style>.foo { color: #fff; }</style> <script>alert("hello world");</script>',
         '<b>Lorem</b> <a href="pants" title="foo">ipsum</a> <a href="http://foo.com/"><strong>dolor</strong></a> sit<br>amet .foo { color: #fff; } '