Skip to content

Commit

Permalink
backport dynamic finder fix (CVE-2012-5664)
Browse files Browse the repository at this point in the history
  • Loading branch information
technoweenie committed Jan 2, 2013
1 parent b18f5c9 commit 46f1ddb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion activerecord/lib/active_record/base.rb
Expand Up @@ -1897,7 +1897,11 @@ def method_missing(method_id, *arguments, &block)
# end
self.class_eval <<-EOS, __FILE__, __LINE__ + 1
def self.#{method_id}(*args)
options = args.extract_options!
options = if args.length > #{attribute_names.size}
args.extract_options!
else
{}
end
attributes = construct_attributes_from_arguments(
[:#{attribute_names.join(',:')}],
args
Expand Down

0 comments on commit 46f1ddb

Please sign in to comment.