summaryrefslogtreecommitdiffstats
path: root/app/helpers/application_helper.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-10 21:38:11 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-10 21:38:11 +0000
commitd0ffc0575a65dda03025d1d4e112ebd06f47ae7e (patch)
treeb66ad02bce0b96ece5a70865a33ad834b2a5215f /app/helpers/application_helper.rb
parenta103e0cd26fd1ffc8772a7f3ee27eb626fa2e722 (diff)
downloadredmine-d0ffc0575a65dda03025d1d4e112ebd06f47ae7e.tar.gz
redmine-d0ffc0575a65dda03025d1d4e112ebd06f47ae7e.zip
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
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r--app/helpers/application_helper.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index afc6acb9c..4118d5bac 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 && 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