mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Use unpack1 instead of unpack and [0]
[Feature #13943][ruby-core:83027] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2d42119903
commit
5723d9fd34
1 changed files with 1 additions and 1 deletions
|
@ -994,7 +994,7 @@ class ERB
|
||||||
#
|
#
|
||||||
def url_encode(s)
|
def url_encode(s)
|
||||||
s.to_s.b.gsub(/[^a-zA-Z0-9_\-.~]/n) { |m|
|
s.to_s.b.gsub(/[^a-zA-Z0-9_\-.~]/n) { |m|
|
||||||
sprintf("%%%02X", m.unpack("C")[0])
|
sprintf("%%%02X", m.unpack1("C"))
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
alias u url_encode
|
alias u url_encode
|
||||||
|
|
Loading…
Reference in a new issue