Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 7084

Show
Ignore:
Timestamp:
06/23/07 00:13:40 (1 year ago)
Author:
bitsweat
Message:

Don't mistakenly interpret the request uri as the query string. Closes #8731.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r7034 r7084  
    11*SVN* 
     2 
     3* Don't mistakenly interpret the request uri as the query string.  #8731 [lifofifo, Jeremy Kemper] 
    24 
    35* 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] 
  • trunk/actionpack/lib/action_controller/cgi_process.rb

    r6823 r7084  
    4848 
    4949    def query_string 
    50       qs = @cgi.query_string 
     50      qs = @cgi.query_string if @cgi.respond_to?(:query_string) 
    5151      if !qs.blank? 
    5252        qs 
    5353      elsif uri = @env['REQUEST_URI'] 
    54         uri.split('?', 2).last 
     54        uri.split('?', 2)[1] || '' 
    5555      else 
    5656        @env['QUERY_STRING'] || '' 
  • trunk/actionpack/test/controller/cgi_test.rb

    r6815 r7084  
    6868    assert_equal({"flamenco"=> "love"}, @request.request_parameters) 
    6969  end 
     70 
     71  def test_doesnt_interpret_request_uri_as_query_string_when_missing 
     72    @request.env['REQUEST_URI'] = 'foo' 
     73    assert_equal({}, @request.query_parameters) 
     74  end 
    7075end 
    7176