mirror of
https://github.com/redmine/redmine.git
synced 2025-11-15 09:46:02 +01:00
Fixed that viewing the history of a wiki page with attachments raises an error (#12801).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11157 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -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 && obj.respond_to?(:attachments))
|
||||
if options[:attachments].present? || obj.respond_to?(:attachments)
|
||||
attachments = options[:attachments] || []
|
||||
attachments += obj.attachments if obj
|
||||
attachments += obj.attachments if obj.respond_to?(:attachments)
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user