From 9cdfe3496f45c4f8e593d4d2b4fb657b93887e5a Mon Sep 17 00:00:00 2001 From: wakou Date: Wed, 24 May 2000 07:10:25 +0000 Subject: Wed May 24 16:03:06 2000 Wakou Aoyama * 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 --- lib/cgi.rb | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'lib/cgi.rb') diff --git a/lib/cgi.rb b/lib/cgi.rb index 7317670154..66336e606e 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 + === Version 1.31 - wakou 2000/05/08 21:51:30 -- cgit v1.2.3