diff --git a/activesupport/lib/active_support/cache/file_store.rb b/activesupport/lib/active_support/cache/file_store.rb index e7316b23b3..89bdb741d0 100644 --- a/activesupport/lib/active_support/cache/file_store.rb +++ b/activesupport/lib/active_support/cache/file_store.rb @@ -1,7 +1,7 @@ require 'active_support/core_ext/file/atomic' require 'active_support/core_ext/string/conversions' require 'active_support/core_ext/object/inclusion' -require 'rack/utils' +require 'uri/common' module ActiveSupport module Cache @@ -126,7 +126,7 @@ module ActiveSupport # Translate a key into a file path. def key_file_path(key) - fname = Rack::Utils.escape(key) + fname = URI.encode_www_form_component(key) hash = Zlib.adler32(fname) hash, dir_1 = hash.divmod(0x1000) dir_2 = hash.modulo(0x1000) @@ -144,7 +144,7 @@ module ActiveSupport # Translate a file path into a key. def file_path_key(path) fname = path[cache_path.to_s.size..-1].split(File::SEPARATOR, 4).last - Rack::Utils.unescape(fname) + URI.decode_www_form_component(fname, Encoding::UTF_8) end # Delete empty directories in the cache.