diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-09-05 11:03:59 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-09-05 11:03:59 -0700 |
commit | d8e5dafa2981fdfc71eb919d482c43d3ec67d4fb (patch) | |
tree | f21b164deebd8446a004b3e9a7dc946b7174666f | |
parent | 6b4909ba0cb3ea5249766d3611c345865b7e214d (diff) | |
parent | 3b46636a0ef831de1fb1fe00738682f980ef7027 (diff) | |
download | rack-d8e5dafa2981fdfc71eb919d482c43d3ec67d4fb.tar.gz |
Merge pull request #936 from deepj/remove-scrub_filename
Remove `scrub_filename` in favor of the native string `scrub!` method
-rw-r--r-- | lib/rack/multipart/parser.rb | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/lib/rack/multipart/parser.rb b/lib/rack/multipart/parser.rb index 5a645169..8196207c 100644 --- a/lib/rack/multipart/parser.rb +++ b/lib/rack/multipart/parser.rb @@ -310,7 +310,7 @@ module Rack filename = Utils.unescape(filename) end - scrub_filename(filename) + filename.scrub! if filename !~ /\\[^\\"]/ filename = filename.gsub(/\\(.)/, '\1') @@ -323,15 +323,6 @@ module Rack filename end - def scrub_filename(filename) - unless filename.valid_encoding? - # FIXME: this force_encoding is for Ruby 2.0 and 1.9 support. - # We can remove it after they are dropped - filename.force_encoding(Encoding::ASCII_8BIT) - filename.encode!(:invalid => :replace, :undef => :replace) - end - end - CHARSET = "charset" def tag_multipart_encoding(filename, content_type, name, body) |