diff options
author | xibbar <xibbar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-16 23:52:43 +0000 |
---|---|---|
committer | xibbar <xibbar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-16 23:52:43 +0000 |
commit | 747b1a3188125a93be49d8cdd1781f768c191ba8 (patch) | |
tree | f80c8f04276cba3a2782240a1364266d43af8366 /lib | |
parent | 8795574510d8fa852755c26433ecd812f7c1f2e0 (diff) | |
download | ruby-747b1a3188125a93be49d8cdd1781f768c191ba8.tar.gz |
* lib/erb.rb (ERB::Util#url_encode): Unuse regexp special global
variable. [Feature #8648] Thanks to fotos.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/erb.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/erb.rb b/lib/erb.rb index 510eae9a1e..a8999d9502 100644 --- a/lib/erb.rb +++ b/lib/erb.rb @@ -948,8 +948,8 @@ class ERB # Programming%20Ruby%3A%20%20The%20Pragmatic%20Programmer%27s%20Guide # def url_encode(s) - s.to_s.b.gsub(/[^a-zA-Z0-9_\-.]/n) { - sprintf("%%%02X", $&.unpack("C")[0]) + s.to_s.b.gsub(/[^a-zA-Z0-9_\-.]/n) { |m| + sprintf("%%%02X", m.unpack("C")[0]) } end alias u url_encode |