aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-06-08 23:05:05 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-06-08 23:05:05 -0300
commitd0de07d21e29149fcd576df1e1f4547fac399603 (patch)
tree87d6a1f1075caeeb0e31b99be97cc97495da5a68
parentbbbe1a58e60da079d5d353777561d1c998549571 (diff)
parentb28b192af194ca63fad6e3cde3b56b78f9132cac (diff)
downloadrails-d0de07d21e29149fcd576df1e1f4547fac399603.tar.gz
rails-d0de07d21e29149fcd576df1e1f4547fac399603.tar.bz2
rails-d0de07d21e29149fcd576df1e1f4547fac399603.zip
Merge pull request #20486 from repinel/improve-gsub-and-global-vars
Use block variable instead of global
-rw-r--r--activesupport/lib/active_support/core_ext/uri.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/uri.rb b/activesupport/lib/active_support/core_ext/uri.rb
index bfe0832b37..0b2ff817c3 100644
--- a/activesupport/lib/active_support/core_ext/uri.rb
+++ b/activesupport/lib/active_support/core_ext/uri.rb
@@ -12,7 +12,7 @@ unless str == parser.unescape(parser.escape(str))
# YK: My initial experiments say yes, but let's be sure please
enc = str.encoding
enc = Encoding::UTF_8 if enc == Encoding::US_ASCII
- str.gsub(escaped) { [$&[1, 2].hex].pack('C') }.force_encoding(enc)
+ str.gsub(escaped) { |match| [match[1, 2].hex].pack('C') }.force_encoding(enc)
end
end
end