[#2840] Changing Resolv::DNS — Daniel Hobe <daniel@...>
I put out a RCR a while ago (176) that subclassed the Resolv::DNS class to
5 messages
2004/05/01
[#2853] cgi.rb: option to omit HTTP header emission — Jos Backus <jos@...>
I'm trying to use cgi.rb to write HTML-only output. This patch adds a
5 messages
2004/05/06
[#2867] ruby/dl — Jeff Mitchell <quixoticsycophant@...>
# dltest.rb
7 messages
2004/05/12
[#2878] Bug in open-uri under win32 (?) — Mauricio Fern疣dez <batsman.geo@...>
4 messages
2004/05/16
[#2894] RI for distribution — why the lucky stiff <ruby-core@...>
Hi, everyone.
6 messages
2004/05/18
[#2901] test/yaml/test_yaml.rb — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
Hello.
2 messages
2004/05/19
[#2913] [yaml] YAML.load([1,2,3].to_yaml.to_yaml) — Jeff Mitchell <quixoticsycophant@...>
A bit contrived,
8 messages
2004/05/20
[#2926] Re: [bug] [yaml] YAML.load([1,2,3].to_yaml.to_yaml)
— "daz" <dooby@...10.karoo.co.uk>
2004/05/23
[#2927] Re: [bug] [yaml] YAML.load([1,2,3].to_yaml.to_yaml)
— ts <decoux@...>
2004/05/23
>>>>> "d" == daz <dooby@d10.karoo.co.uk> writes:
[#2928] Syck CVS (was Re: [bug] [yaml] YAML.load([1,2,3].to_yaml.to_yaml))
— why the lucky stiff <ruby-core@...>
2004/05/23
ts wrote:
[#2929] Re: Syck CVS (was Re: [bug] [yaml] YAML.load([1,2,3].to_yaml.to_yaml))
— ts <decoux@...>
2004/05/23
>>>>> "w" == why the lucky stiff <ruby-core@whytheluckystiff.net> writes:
[#2918] fixed SIG_SEGV in check_stack() in eval.c — b g <bg_rubyposter_123456@...>
I was getting a crash at 'JUMP_TAG(state);' in
6 messages
2004/05/22
[#2938] -Wstrict-prototypes for extensions — Jeff Mitchell <quixoticsycophant@...>
6 messages
2004/05/25
Buggy form generation with cgi.rb
From:
evanm@...
Date:
2004-05-24 13:05:45 UTC
List:
ruby-core #2933
Hi all,
Using cgi.rb with cgi/session.rb, I found there is improper HTML generated
automatically when using a form with html4:
irb(main):001:0> require 'cgi'
=> true
irb(main):002:0> c = CGI.new('html4')
(offline mode: enter name=value pairs on standard input)
=> #<CGI:0x403fa560 @cookies={}, @output_cookies=nil, @multipart=false,
@output_hidden=nil, @params={}>
irb(main):003:0> c.form {}
=> "<FORM METHOD=\"post\"
ENCTYPE=\"application/x-www-form-urlencoded\"></FORM>"
irb(main):004:0> require 'cgi/session'
=> true
irb(main):005:0> s = CGI::Session.new(c)
=> #<CGI::Session:0x403c232c @dbprot=[#<CGI::Session::FileStore:0x403c1d64
@f=#<File:/tmp/37dacbc366cea4c7>, @hash={}>],
@dbman=#<CGI::Session::FileStore:0x403c1d64 @f=#<File:/tmp/37dacbc366cea4c7>,
@hash={}>, @session_id="37dacbc366cea4c7">
irb(main):006:0> c.form {''}
=> "<FORM METHOD=\"post\"
ENCTYPE=\"application/x-www-form-urlencoded\"><FIELDSET><INPUT TYPE=HIDDEN
NAME=\"_session_id\" VALUE=\"37dacbc366cea4c7\"></FIELDSET></FORM>"
Some folks in #ruby-lang pointed me to this patch which seems cause some of
these issues:
http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/ruby/lib/cgi.rb.diff?r1=1.41;r2=1.42
There's several problems here, however:
1) The FIELDSET creates a visible box whenever a form is used.
2) The previous DIV usage is incorrect too, no block container is needed at
all
3) The HIDDEN is not quoted.
4) The entire extra hidden input is useless, as session uses cookies to store
the session ID.
Below are patches to cgi.rb and session.rb. If I am in error and the extra
hidden input is actually used for something, then please at least remove all
DIVs and FIELDSETs from the generated HTML.
--- session.rb.bak 2004-05-24 05:40:52.522375128 -0700
+++ session.rb 2004-05-24 05:46:36.474086520 -0700
@@ -53,7 +53,6 @@
dbman = option['database_manager'] || FileStore
@dbman = dbman::new(self, option)
request.instance_eval do
- @output_hidden = {session_key => id}
@output_cookies = [
Cookie::new("name" => session_key,
"value" => id,
--- cgi.rb.bak 2004-05-24 05:41:28.417918176 -0700
+++ cgi.rb 2004-05-24 05:46:25.491756088 -0700
@@ -1308,16 +1308,6 @@
else
body = ""
end
- if @output_hidden
- hidden = @output_hidden.collect{|k,v|
- "<INPUT TYPE=HIDDEN NAME=\"#{k}\" VALUE=\"#{v}\">"
- }.to_s
- if defined? fieldset
- body += fieldset{ hidden }
- else
- body += hidden
- end
- end
super(attributes){body}
end