Feature #255

CGI element generation methods should convert keys/values to Strings before escaping.

Added by Anonymous almost 7 years ago. Updated about 4 years ago.

[ruby-core:17724]
Status:Closed
Priority:Normal
Assignee:Takeyuki FUJIOKA

Description

=begin
@cgi.file_field("test", 40)
# => ''

@cgi.file_field("NAME" => "test", "SIZE" => 40)
# => private method `gsub' called for 40:Fixnum

The attached patch fixes this issue for all element generation methods.
Additionally, it allows passing Symbols instead of Strings for attribute names.

@cgi.file_field("NAME" => "test", "SIZE" => 40)
# => ''

@cgi.file_field(:NAME => "test", :SIZE => 40)
# => ''
=end

cgi_elements.patch Magnifier (604 Bytes) Anonymous, 07/10/2008 10:10 PM

new_cgi_elements.patch Magnifier - New patch (395 Bytes) Arthur Schreiber, 07/18/2008 06:33 PM

Associated revisions

Revision 39575
Added by Zachary Scott over 2 years ago

  • encoding.c: Typo in Encoding overview by Tom Wardrop [GH fixes #255]

Revision 39575
Added by Zachary Scott over 2 years ago

  • encoding.c: Typo in Encoding overview by Tom Wardrop [GH fixes #255]

History

#1 Updated by Arthur Schreiber almost 7 years ago

=begin
Just wanted to say that this report and the patch are by me.
=end

#2 Updated by Arthur Schreiber almost 7 years ago

=begin
Ok, the old patch is bugged.
Converting keys to Strings using #to_s might result in duplicated element attributes, so this change has been removed.

New patch attached.
=end

#3 Updated by Yui NARUSE almost 7 years ago

  • Assignee set to Takeyuki FUJIOKA

=begin

=end

#4 Updated by Yuki Sonoda almost 7 years ago

  • Target version set to 1.9.1 Release Candidate

=begin

=end

#5 Updated by Takeyuki FUJIOKA over 6 years ago

  • Status changed from Open to Closed

=begin

=end

Also available in: Atom PDF