Ticket #11591: support_forgery_patch.diff
| File support_forgery_patch.diff, 1.1 kB (added by CreatixEA, 6 months ago) |
|---|
-
lib/auto_complete_macros_helper.rb
old new 69 69 js_options[:paramName] = "'#{options[:param_name]}'" if options[:param_name] 70 70 js_options[:frequency] = "#{options[:frequency]}" if options[:frequency] 71 71 js_options[:method] = "'#{options[:method].to_s}'" if options[:method] 72 73 # Emilien ARNAUD changes - add the authenticity token with exactly the same code 74 # from the prototype_helper: 75 if protect_against_forgery? 76 if js_options[:parameters] 77 js_options[:parameters] << " + '&" 78 else 79 js_options[:parameters] = "'" 80 end 81 js_options[:parameters] << "#{request_forgery_protection_token}=' + encodeURIComponent('#{escape_javascript form_authenticity_token}')" 82 end 83 # End of Emilien ARNAUD changes 72 84 73 85 { :after_update_element => :afterUpdateElement, 74 86 :on_show => :onShow, :on_hide => :onHide, :min_chars => :minChars }.each do |k,v|