From 5723d9fd347f4a3e309cfbae93979ae70577aa28 Mon Sep 17 00:00:00 2001 From: kazu Date: Fri, 29 Sep 2017 11:00:00 +0000 Subject: [PATCH] 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 --- lib/erb.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/erb.rb b/lib/erb.rb index 74974696d7..47bb5022cc 100644 --- a/lib/erb.rb +++ b/lib/erb.rb @@ -994,7 +994,7 @@ class ERB # def url_encode(s) s.to_s.b.gsub(/[^a-zA-Z0-9_\-.~]/n) { |m| - sprintf("%%%02X", m.unpack("C")[0]) + sprintf("%%%02X", m.unpack1("C")) } end alias u url_encode