Skip to content

Commit

Permalink
[BUG FIX] Form inputs with no name attribute blew up in Safari.
Browse files Browse the repository at this point in the history
  • Loading branch information
bernerdschaefer committed Feb 13, 2009
1 parent 86d1c3a commit aa371a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -32,7 +32,7 @@ require "rake/gempackagetask"

NAME = "wheels"
SUMMARY = "Wheels Framework"
GEM_VERSION = "0.2.5.1"
GEM_VERSION = "0.2.5.2"

spec = Gem::Specification.new do |s|
s.name = NAME
Expand Down
8 changes: 7 additions & 1 deletion lib/wheels/rack/utils.rb
Expand Up @@ -2,12 +2,18 @@ module Rack
module Utils
def parse_query(qs, d = '&;')
params = {}

(qs || '').split(/[#{d}] */n).each do |param|
next if param == ''

keys, value = unescape(param).split("=", 2)
keys = keys.scan /[^\[\]]+|(?=\[\])/
key = keys.pop

# If an input has no key, Firefox will not send it, but
# Safari will, so we ignore key-less form values.
next unless key

if key.empty?
key = keys.pop
hash = keys.inject(params) { |h, k| h[k] ||= {} }
Expand All @@ -21,7 +27,7 @@ def parse_query(qs, d = '&;')
params
end
module_function :parse_query

module Multipart
$VERBOSE, __verbose = nil, $VERBOSE
EOL = "\r\n"
Expand Down

0 comments on commit aa371a3

Please sign in to comment.