diff --git a/ChangeLog b/ChangeLog index e7e7a39504..e683cd54d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sun Aug 25 20:10:32 2002 Wakou Aoyama + + * lib/cgi.rb (CGI#form): fix ruby-bugs-ja:PR#280, add default action. + Sat Aug 24 15:32:16 2002 Nobuyoshi Nakada * eval.c (call_trace_func): restore source file/line, as trace diff --git a/lib/cgi.rb b/lib/cgi.rb index 7870c8125b..714a3a2099 100644 --- a/lib/cgi.rb +++ b/lib/cgi.rb @@ -1253,7 +1253,7 @@ convert string charset, and set language to "ja". The hash keys are case sensitive. Ask the samples. =end - def form(method = "post", action = nil, enctype = "application/x-www-form-urlencoded") + def form(method = "post", action = script_name, enctype = "application/x-www-form-urlencoded") attributes = if method.kind_of?(String) { "METHOD" => method, "ACTION" => action, "ENCTYPE" => enctype } @@ -1273,9 +1273,13 @@ The hash keys are case sensitive. Ask the samples. end if @output_hidden hidden = @output_hidden.collect{|k,v| - "
" + "" }.to_s - body += hidden + if defined? fieldset + body += fieldset{ hidden } + else + body += hidden + end end super(attributes){body} end