mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
8795574510
commit
747b1a3188
1 changed files with 2 additions and 2 deletions
|
@ -948,8 +948,8 @@ class ERB
|
||||||
# Programming%20Ruby%3A%20%20The%20Pragmatic%20Programmer%27s%20Guide
|
# Programming%20Ruby%3A%20%20The%20Pragmatic%20Programmer%27s%20Guide
|
||||||
#
|
#
|
||||||
def url_encode(s)
|
def url_encode(s)
|
||||||
s.to_s.b.gsub(/[^a-zA-Z0-9_\-.]/n) {
|
s.to_s.b.gsub(/[^a-zA-Z0-9_\-.]/n) { |m|
|
||||||
sprintf("%%%02X", $&.unpack("C")[0])
|
sprintf("%%%02X", m.unpack("C")[0])
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
alias u url_encode
|
alias u url_encode
|
||||||
|
|
Loading…
Reference in a new issue