Permalink
Browse files

Switch token_tag if block

  • Loading branch information...
1 parent acb3984 commit 5636010392b12273324846cf1d8baa46d0d857da @oscardelben oscardelben committed May 5, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 actionpack/lib/action_view/helpers/url_helper.rb
@@ -670,11 +670,11 @@ def convert_boolean_attributes!(html_options, bool_attrs)
end
def token_tag(token=nil)
- if token == false || !protect_against_forgery?
- ''
- else
+ if token != false && protect_against_forgery?
token ||= form_authenticity_token
tag(:input, :type => "hidden", :name => request_forgery_protection_token.to_s, :value => token)
+ else
+ ''
end
end

0 comments on commit 5636010

Please sign in to comment.