Feature #255
CGI element generation methods should convert keys/values to Strings before escaping.
| Status: | Closed | Start date: | 07/10/2008 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | - | |||
| Target version: | 1.9.1 Release Candidate |
Description
@cgi.file_field("test", 40)
# => '<INPUT SIZE="40" NAME="test" TYPE="file">'
@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)
# => '<INPUT SIZE="40" NAME="test" TYPE="file">'
@cgi.file_field(:NAME => "test", :SIZE => 40)
# => '<INPUT SIZE="40" NAME="test" TYPE="file">'
History
Updated by NoKarma (Arthur Schreiber) almost 4 years ago
Just wanted to say that this report and the patch are by me.
Updated by NoKarma (Arthur Schreiber) almost 4 years ago
- File new_cgi_elements.patch added
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.
Updated by naruse (Yui NARUSE) over 3 years ago
- Assignee set to xibbar (Takeyuki Fujioka)
Updated by yugui (Yuki Sonoda) over 3 years ago
- Target version set to 1.9.1 Release Candidate
Updated by xibbar (Takeyuki Fujioka) over 3 years ago
- Status changed from Open to Closed