diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-01-10 21:40:04 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-01-10 21:40:04 +0000 |
commit | 18061b641fe8671d4fd28c8ab3adfa2fe12f19aa (patch) | |
tree | f1457c72d84eed6c9c918d258da4dc1207487f19 | |
parent | d0ffc0575a65dda03025d1d4e112ebd06f47ae7e (diff) | |
download | redmine-18061b641fe8671d4fd28c8ab3adfa2fe12f19aa.tar.gz redmine-18061b641fe8671d4fd28c8ab3adfa2fe12f19aa.zip |
Code cleanup (#12801).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11158 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/helpers/application_helper.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4118d5bac..07242c005 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -545,9 +545,9 @@ module ApplicationHelper def parse_inline_attachments(text, project, obj, attr, only_path, options) # when using an image link, try to use an attachment, if possible - if options[:attachments].present? || obj.respond_to?(:attachments) - attachments = options[:attachments] || [] - attachments += obj.attachments if obj.respond_to?(:attachments) + attachments = options[:attachments] || [] + attachments += obj.attachments if obj.respond_to?(:attachments) + if attachments.present? text.gsub!(/src="([^\/"]+\.(bmp|gif|jpg|jpe|jpeg|png))"(\s+alt="([^"]*)")?/i) do |m| filename, ext, alt, alttext = $1.downcase, $2, $3, $4 # search for the picture in attachments |