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("") %>

diff --git a/app/views/comment/_comment_form.html.erb b/app/views/comment/_comment_form.html.erb index da50b79..8aea736 100644 --- a/app/views/comment/_comment_form.html.erb +++ b/app/views/comment/_comment_form.html.erb @@ -79,7 +79,7 @@ function check_captcha(button, confirm_action) { <%= hidden_field_tag(:view, params[:view])%> <%= f.hidden_field(:reply_of_id) %> - <%= @plugins.dispatch(:comment_form_extra_contents, local_assigns).collect { |content| instance_eval(&content) }.join("") %> + <%= @plugins.dispatch(:comment_form_extra_contents, local_assigns).collect { |content| instance_exec(&content) }.join("") %> <% button_bar do %> <%= submit_button('add', _('Post comment'), :onclick => "if(check_captcha(this)) { save_comment(this) } else { check_captcha(this, save_comment)};return false;") %> diff --git a/app/views/content_viewer/_article_toolbar.html.erb b/app/views/content_viewer/_article_toolbar.html.erb index b36ffa3..3e9ce65 100644 --- a/app/views/content_viewer/_article_toolbar.html.erb +++ b/app/views/content_viewer/_article_toolbar.html.erb @@ -60,7 +60,7 @@
<%= image_tag(@page.image.public_filename())%>
<% end %> <%= link_to(image_tag('icons-mime/rss-feed.png'), @page.feed.url, :class => 'blog-feed-link') if @page.has_posts? && @page.feed %> - <%= @plugins.dispatch(:article_header_extra_contents, @page).collect { |content| instance_eval(&content) }.join("") %> + <%= @plugins.dispatch(:article_header_extra_contents, @page).collect { |content| instance_exec(&content) }.join("") %> <%= article_title(@page, :no_link => true) %> <%= article_translations(@page) %>
diff --git a/app/views/content_viewer/view_page.html.erb b/app/views/content_viewer/view_page.html.erb index 2ef42a8..8f12455 100644 --- a/app/views/content_viewer/view_page.html.erb +++ b/app/views/content_viewer/view_page.html.erb @@ -70,7 +70,7 @@ <%= display_source_info(@page) %> -<%= @plugins.dispatch(:article_extra_contents, @page).collect { |content| instance_eval(&content) }.join("") %> +<%= @plugins.dispatch(:article_extra_contents, @page).collect { |content| instance_exec(&content) }.join("") %>
diff --git a/app/views/layouts/_user.html.erb b/app/views/layouts/_user.html.erb index 9734998..6c6fe39 100644 --- a/app/views/layouts/_user.html.erb +++ b/app/views/layouts/_user.html.erb @@ -5,7 +5,7 @@