Permalink
Browse files

Merge pull request #6171 from oscardelben/move_token_tag_if_block

Switch token_tag if block
  • Loading branch information...
2 parents 99e2a22 + 5636010 commit 7be33feb17cb3af52025e959d40efe02ddbdcc4c @rafaelfranca rafaelfranca committed May 12, 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 7be33fe

Please sign in to comment.