From: Jean-Philippe Lang Date: Sun, 28 Dec 2008 13:45:53 +0000 (+0000) Subject: Backported r2192 from trunk. X-Git-Tag: 0.7.4~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7da7e853a34773ef6786b184a9e52bc86cab1507;p=redmine.git Backported r2192 from trunk. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.7-stable@2194 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/lib/redcloth.rb b/lib/redcloth.rb index 421346cc7..7111de513 100644 --- a/lib/redcloth.rb +++ b/lib/redcloth.rb @@ -465,8 +465,7 @@ class RedCloth < String style << "vertical-align:#{ v_align( $& ) };" if text =~ A_VLGN end - style << "#{ htmlesc $1 };" if not filter_styles and - text.sub!( /\{([^}]*)\}/, '' ) + style << "#{ htmlesc $1 };" if text.sub!( /\{([^}]*)\}/, '' ) && !filter_styles lang = $1 if text.sub!( /\[([^)]+?)\]/, '' ) diff --git a/lib/redmine/wiki_formatting.rb b/lib/redmine/wiki_formatting.rb index 39b81e44a..3fbb108ad 100644 --- a/lib/redmine/wiki_formatting.rb +++ b/lib/redmine/wiki_formatting.rb @@ -32,6 +32,7 @@ module Redmine super self.hard_breaks=true self.no_span_caps=true + self.filter_styles=true end def to_html(*rules, &block) diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index 04449d921..9b8debc97 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -49,7 +49,8 @@ class ApplicationHelperTest < HelperTestCase '!http://foo.bar/image.jpg!' => '', 'floating !>http://foo.bar/image.jpg!' => 'floating
', 'with class !(some-class)http://foo.bar/image.jpg!' => 'with class ', - 'with style !{width:100px;height100px}http://foo.bar/image.jpg!' => 'with style ', + # inline styles should be stripped + 'with style !{width:100px;height100px}http://foo.bar/image.jpg!' => 'with style ', 'with title !http://foo.bar/image.jpg(This is a title)!' => 'with title This is a title', 'with title !http://foo.bar/image.jpg(This is a double-quoted "title")!' => 'with title This is a double-quoted "title"', }