GitLab steht wegen Wartungsarbeiten am Montag, den 10. Mai, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

Commit dfa662f3 authored by jplang's avatar jplang

Code cleanup (#12801).

git-svn-id: https://svn.redmine.org/redmine/trunk@11158 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 1fddd10b
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment