diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-06-23 00:13:40 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-06-23 00:13:40 +0000 |
commit | 9159489872a1dd2038888b72b6990484a24ccad8 (patch) | |
tree | 9828e78b965dc1c135d4eb2010bd7e90ba5a005f | |
parent | 3bf3042a6cd29fd3ccc18541e84ea8ca5c791889 (diff) | |
download | rails-9159489872a1dd2038888b72b6990484a24ccad8.tar.gz rails-9159489872a1dd2038888b72b6990484a24ccad8.tar.bz2 rails-9159489872a1dd2038888b72b6990484a24ccad8.zip |
Don't mistakenly interpret the request uri as the query string. Closes #8731.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7084 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | actionpack/CHANGELOG | 2 | ||||
-rw-r--r-- | actionpack/lib/action_controller/cgi_process.rb | 4 | ||||
-rwxr-xr-x | actionpack/test/controller/cgi_test.rb | 5 |
3 files changed, 9 insertions, 2 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index 85d0a6f541..bff0c2868e 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Don't mistakenly interpret the request uri as the query string. #8731 [lifofifo, Jeremy Kemper] + * Make ActionView#view_paths an attr_accessor for real this time. Also, don't perform an unnecessary #compact on the @view_paths array in #initialize. Closes #8582 [dasil003, julik, rick] * Tolerate missing content type on multipart file uploads. Fix for Safari 3. [Jeremy Kemper] diff --git a/actionpack/lib/action_controller/cgi_process.rb b/actionpack/lib/action_controller/cgi_process.rb index edb7fb38d8..fa7afd4197 100644 --- a/actionpack/lib/action_controller/cgi_process.rb +++ b/actionpack/lib/action_controller/cgi_process.rb @@ -47,11 +47,11 @@ module ActionController #:nodoc: end def query_string - qs = @cgi.query_string + qs = @cgi.query_string if @cgi.respond_to?(:query_string) if !qs.blank? qs elsif uri = @env['REQUEST_URI'] - uri.split('?', 2).last + uri.split('?', 2)[1] || '' else @env['QUERY_STRING'] || '' end diff --git a/actionpack/test/controller/cgi_test.rb b/actionpack/test/controller/cgi_test.rb index da3ca245e1..a5b24ebcd4 100755 --- a/actionpack/test/controller/cgi_test.rb +++ b/actionpack/test/controller/cgi_test.rb @@ -67,6 +67,11 @@ class CgiRequestParamsParsingTest < BaseCgiTest @request.env['RAW_POST_DATA'] = data assert_equal({"flamenco"=> "love"}, @request.request_parameters) end + + def test_doesnt_interpret_request_uri_as_query_string_when_missing + @request.env['REQUEST_URI'] = 'foo' + assert_equal({}, @request.query_parameters) + end end |