summaryrefslogtreecommitdiff
path: root/lib/cgi/util.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-20 11:54:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-20 11:54:54 +0000
commitce7f7f5e3d6c288b140870fa87c4b11e9a744f62 (patch)
tree54ca2134480577b0aa5c5001b1657d5fc4adfaf4 /lib/cgi/util.rb
parent28dc41090aaaf6f43a29c1b6fd4f49192540c256 (diff)
cgi/escape: Optimize CGI.escapeHTML
* cgi/escape/escape.c: Optimize CGI.escapeHTML for ASCII-compatible encodings. [Fix GH-1164] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/cgi/util.rb')
-rw-r--r--lib/cgi/util.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/cgi/util.rb b/lib/cgi/util.rb
index c2327072398..83c310b3cb5 100644
--- a/lib/cgi/util.rb
+++ b/lib/cgi/util.rb
@@ -38,6 +38,11 @@ module CGI::Util
string.gsub(/['&\"<>]/, TABLE_FOR_ESCAPE_HTML__)
end
+ begin
+ require 'cgi/escape'
+ rescue LoadError
+ end
+
# Unescape a string that has been HTML-escaped
# CGI::unescapeHTML("Usage: foo &quot;bar&quot; &lt;baz&gt;")
# # => "Usage: foo \"bar\" <baz>"