Permalink
Browse files

String#[] doesn't return the byte representation on 1.9.2, we should …

…use getbyte that was already added as a Ruby < 1.9 core_ext

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
1 parent fa96638 commit a822ce78b39db60fef9d8c3280551f199c91c6b3 @spastorino spastorino committed with josevalim Jun 27, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 activesupport/lib/active_support/cache/mem_cache_store.rb
View
2 activesupport/lib/active_support/cache/mem_cache_store.rb
@@ -159,7 +159,7 @@ def delete_entry(key, options) # :nodoc:
private
def escape_key(key)
- key = key.to_s.gsub(ESCAPE_KEY_CHARS){|match| "%#{match[0].to_s(16).upcase}"}
+ key = key.to_s.gsub(ESCAPE_KEY_CHARS){|match| "%#{match.getbyte(0).to_s(16).upcase}"}
key = "#{key[0, 213]}:md5:#{Digest::MD5.hexdigest(key)}" if key.size > 250
key
end

0 comments on commit a822ce7

Please sign in to comment.