diff options
author | deepj <deepjungle.maca@gmail.com> | 2015-08-30 14:20:53 +0200 |
---|---|---|
committer | deepj <deepjungle.maca@gmail.com> | 2015-08-30 14:20:53 +0200 |
commit | 3b46636a0ef831de1fb1fe00738682f980ef7027 (patch) | |
tree | 6120421953850a6b9218446e785fb92116ad6179 | |
parent | 9792bf590add0f09f301f00cdb296b333ec01f24 (diff) | |
download | rack-3b46636a0ef831de1fb1fe00738682f980ef7027.tar.gz |
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) |