Fix some Helper Methods

It seems that (advertising to the contrary)
Rails's XSS Protection is enabled, by default
in 2.3.8. So needed to fix some helper methods.
This commit is contained in:
Jacques Distler 2010-05-25 12:59:35 -05:00
parent f0635301aa
commit d6be09e0f0

View file

@ -44,11 +44,11 @@ module WikiHelper
link_to('Forward in time', link_to('Forward in time',
{:web => @web.address, :action => 'revision', :id => @page.name, :rev => @revision_number + 1}, {:web => @web.address, :action => 'revision', :id => @page.name, :rev => @revision_number + 1},
{:class => 'navlink', :accesskey => 'F', :id => 'to_next_revision', :rel => 'nofollow'}) + {:class => 'navlink', :accesskey => 'F', :id => 'to_next_revision', :rel => 'nofollow'}) +
" <span class='revisions'>(#{@revision.page.revisions.size - @revision_number} more)</span> " " <span class='revisions'>(#{@revision.page.revisions.size - @revision_number} more)</span> ".html_safe
else else
link_to('Forward in time', {:web => @web.address, :action => 'show', :id => @page.name}, link_to('Forward in time', {:web => @web.address, :action => 'show', :id => @page.name},
{:class => 'navlink', :accesskey => 'F', :id => 'to_next_revision', :rel => 'nofollow'}) + {:class => 'navlink', :accesskey => 'F', :id => 'to_next_revision', :rel => 'nofollow'}) +
" <span class='revisions'>(to current)</span>" " <span class='revisions'>(to current)</span>".html_safe
end end
end end
@ -56,7 +56,7 @@ module WikiHelper
link_to('Back in time', link_to('Back in time',
{:web => @web.address, :action => 'revision', :id => @page.name, :rev => @revision_number - 1}, {:web => @web.address, :action => 'revision', :id => @page.name, :rev => @revision_number - 1},
{:class => 'navlink', :id => 'to_previous_revision', :rel => 'nofollow'}) + {:class => 'navlink', :id => 'to_previous_revision', :rel => 'nofollow'}) +
" <span class='revisions'>(#{@revision_number - 1} more)</span>" " <span class='revisions'>(#{@revision_number - 1} more)</span>".html_safe
end end
def back_for_page def back_for_page
@ -64,7 +64,7 @@ module WikiHelper
{:web => @web.address, :action => 'revision', :id => @page.name, {:web => @web.address, :action => 'revision', :id => @page.name,
:rev => @page.revisions.size - 1}, :rev => @page.revisions.size - 1},
{:class => 'navlink', :accesskey => 'B', :id => 'to_previous_revision', :rel => 'nofollow'}) + {:class => 'navlink', :accesskey => 'B', :id => 'to_previous_revision', :rel => 'nofollow'}) +
" <span class='revisions'>(#{@page.revisions.size - 1} #{@page.revisions.size - 1 == 1 ? 'revision' : 'revisions'})</span>" " <span class='revisions'>(#{@page.revisions.size - 1} #{@page.revisions.size - 1 == 1 ? 'revision' : 'revisions'})</span>".html_safe
end end
def current_revision def current_revision