summaryrefslogtreecommitdiff
path: root/lib/cgi.rb
diff options
context:
space:
mode:
authorwakou <wakou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-05-24 07:10:25 +0000
committerwakou <wakou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-05-24 07:10:25 +0000
commit9cdfe3496f45c4f8e593d4d2b4fb657b93887e5a (patch)
treeb5e89e07fdbb674793a36e9b48a07792cbb65b26 /lib/cgi.rb
parent8b1de0b1ad49733abeddd8be359ae816b29de59a (diff)
Wed May 24 16:03:06 2000 Wakou Aoyama <wakou@fsinet.or.jp>
* lib/cgi.rb bug fix: CGI::escape(), CGI::Cookie::new() * lib/net/telnet.rb improve: binmode(), telnetmode() interface git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/cgi.rb')
-rw-r--r--lib/cgi.rb23
1 files changed, 18 insertions, 5 deletions
diff --git a/lib/cgi.rb b/lib/cgi.rb
index 7317670..66336e6 100644
--- a/lib/cgi.rb
+++ b/lib/cgi.rb
@@ -5,7 +5,7 @@ $Date$
cgi.rb
-Version 1.31
+Version 1.40
Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
Copyright (C) 2000 Information-technology Promotion Agency, Japan
@@ -185,7 +185,7 @@ class CGI
EOL = CR + LF
v = $-v
$-v = false
- VERSION = "1.31"
+ VERSION = "1.40"
RELEASE_DATE = "$Date$"
$-v = v
@@ -239,8 +239,12 @@ $-v = v
url_encoded_string = CGI::escape("string")
=end
def CGI::escape(string)
- string.gsub(/ /n, '+').gsub(/([^a-zA-Z0-9_.-])/n) do
- sprintf("%%%02X", $1.unpack("C")[0])
+ string.gsub(/([^a-zA-Z0-9_.-])/n) do
+ if " " == $1
+ "+"
+ else
+ sprintf("%%%02X", $1.unpack("C")[0])
+ end
end
end
@@ -603,7 +607,7 @@ convert string charset, and set language to "ja".
@path = @path[0...@path.rindex(ENV["PATH_INFO"])]
end
else
- @path = ENV["SCRIPT_NAME"] or ""
+ @path = (ENV["SCRIPT_NAME"] or "")
end
@domain = options["domain"]
@expires = options["expires"]
@@ -1901,6 +1905,15 @@ end
== HISTORY
+=== Version 1.40 - wakou
+
+2000/05/24 06:58:51
+
+- typo: CGI::Cookie::new()
+- bug fix: CGI::escape()
+ bad: " " --> "%2B" true: " " --> "+"
+ thanks to Ryunosuke Ohshima <ryu@jaist.ac.jp>
+
=== Version 1.31 - wakou
2000/05/08 21:51:30