aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorMark Reginald James <mrj@advancedcontrols.com.au>2008-12-28 01:15:48 +0000
committerYehuda Katz <wycats@gmail.com>2009-01-01 00:13:10 -0800
commitea2090176488246eb780ac654ce5c1063a791dfa (patch)
treea19e9975aef9a14d376c69b0dec7cc38e6fef602 /actionpack/lib
parent373e94a03f1b5d3a2f0551d95c64ebbaf416d47f (diff)
downloadrails-ea2090176488246eb780ac654ce5c1063a791dfa.tar.gz
rails-ea2090176488246eb780ac654ce5c1063a791dfa.tar.bz2
rails-ea2090176488246eb780ac654ce5c1063a791dfa.zip
Fixed incorrect parsing of query parameters with mixed-depth nesting inside an array [#1622 state:resolved]
Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com>
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/url_encoded_pair_parser.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/url_encoded_pair_parser.rb b/actionpack/lib/action_controller/url_encoded_pair_parser.rb
index bea96c711d..9883ad0d85 100644
--- a/actionpack/lib/action_controller/url_encoded_pair_parser.rb
+++ b/actionpack/lib/action_controller/url_encoded_pair_parser.rb
@@ -70,11 +70,12 @@ module ActionController
top[-1][key] = value
else
top << {key => value}.with_indifferent_access
- push top.last
- value = top[key]
end
+ push top.last
+ return top[key]
else
top << value
+ return value
end
elsif top.is_a? Hash
key = CGI.unescape(key)
@@ -84,12 +85,10 @@ module ActionController
else
raise ArgumentError, "Don't know what to do: top is #{top.inspect}"
end
-
- return value
end
def type_conflict!(klass, value)
raise TypeError, "Conflicting types for parameter containers. Expected an instance of #{klass} but found an instance of #{value.class}. This can be caused by colliding Array and Hash parameters like qs[]=value&qs[key]=value. (The parameters received were #{value.inspect}.)"
end
end
-end \ No newline at end of file
+end