diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 964aaa4..5e975f4 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -571,7 +571,7 @@ module ApplicationHelper # #profile_image) and its name below it. def profile_image_link( profile, size=:portrait, tag='li', extra_info = nil ) if content = @plugins.dispatch_first(:profile_image_link, profile, size, tag, extra_info) - return instance_eval(&content) + return instance_exec(&content) end name = profile.short_name if profile.person? @@ -928,7 +928,7 @@ module ApplicationHelper def article_to_html(article, options = {}) options.merge!(:page => params[:npage]) content = article.to_html(options) - content = content.kind_of?(Proc) ? self.instance_eval(&content).html_safe : content.html_safe + content = content.kind_of?(Proc) ? self.instance_exec(&content).html_safe : content.html_safe filter_html(content, article) end @@ -1384,7 +1384,7 @@ module ApplicationHelper doc.search('.macro').each do |macro| macro_name = macro['data-macro'] result = @plugins.parse_macro(macro_name, macro, source) - macro.inner_html = result.kind_of?(Proc) ? self.instance_eval(&result) : result + macro.inner_html = result.kind_of?(Proc) ? self.instance_exec(&result) : result end doc.html end diff --git a/app/helpers/boxes_helper.rb b/app/helpers/boxes_helper.rb index 3659fe2..02863be 100644 --- a/app/helpers/boxes_helper.rb +++ b/app/helpers/boxes_helper.rb @@ -221,7 +221,7 @@ module BoxesHelper if block.embedable? embed_code = block.embed_code - embed_code = instance_eval(&embed_code) if embed_code.respond_to?(:call) + embed_code = instance_exec(&embed_code) if embed_code.respond_to?(:call) html = content_tag('div', content_tag('h2', _('Embed block code')) + content_tag('div', _('Below, you''ll see a field containing embed code for the block. Just copy the code and paste it into your website or blogging software.'), :style => 'margin-bottom: 1em;') + diff --git a/app/helpers/comment_helper.rb b/app/helpers/comment_helper.rb index bff7485..b6907b2 100644 --- a/app/helpers/comment_helper.rb +++ b/app/helpers/comment_helper.rb @@ -23,7 +23,7 @@ module CommentHelper def comment_extra_contents(comment) @plugins.dispatch(:comment_extra_contents, comment).collect do |extra_content| - extra_content.kind_of?(Proc) ? self.instance_eval(&extra_content) : extra_content + extra_content.kind_of?(Proc) ? self.instance_exec(&extra_content) : extra_content end.join('\n') end @@ -41,7 +41,7 @@ module CommentHelper def links_for_comment_actions(comment) actions = [link_for_report_abuse(comment), link_for_spam(comment), link_for_edit(comment), link_for_remove(comment)] @plugins.dispatch(:comment_actions, comment).collect do |action| - actions << (action.kind_of?(Proc) ? self.instance_eval(&action) : action) + actions << (action.kind_of?(Proc) ? self.instance_exec(&action) : action) end actions.flatten.compact end diff --git a/app/mailers/task_mailer.rb b/app/mailers/task_mailer.rb index 7f6cf53..8455c1b 100644 --- a/app/mailers/task_mailer.rb +++ b/app/mailers/task_mailer.rb @@ -45,7 +45,7 @@ class TaskMailer < ActionMailer::Base def extract_message(message) if message.kind_of?(Proc) - self.instance_eval(&message) + self.instance_exec(&message) else message.to_s end diff --git a/app/views/comment/_comment.html.erb b/app/views/comment/_comment.html.erb index 9c67014..4e7aba4 100644 --- a/app/views/comment/_comment.html.erb +++ b/app/views/comment/_comment.html.erb @@ -43,7 +43,7 @@
<%= txt2html comment.body %> - <%= @plugins.dispatch(:comment_extra_contents, local_assigns).collect { |content| instance_eval(&content) }.join("") %> + <%= @plugins.dispatch(:comment_extra_contents, local_assigns).collect { |content| instance_exec(&content) }.join("") %>