Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 75922
Status: rejected
Priority: 0/
Queue: CGI

People
Owner: Nobody in particular
Requestors: MRDVT [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 3.43
  • 3.59
Fixed in: (no value)



Subject: CGI->start_form(-method=>"GET") wrong default enctype
perl -MCGI -e ' print CGI->VERSION, "\n"; print CGI->start_form(-method=>"GET"), "\n" ' Returns 3.43 <form method="get" action="http://localhost" enctype="multipart/form-data"> But, multipart/form-data is an invalid enctype for the GET method. I expect the default encoding to be a valid encoding for the GET method. Actually, this is what I expect. perl -MCGI -e ' print CGI->VERSION, "\n"; print CGI->start_form(-method=>"GET", -enctype=>undef), "\n"; ' 3.43 <form method="get" action="http://localhost" enctype="application/x-www-form-urlencoded"> This logic does not account or GET vs. POST. if( $XHTML ){ $enctype = $self->_maybe_escapeHTML($enctype || &MULTIPART); }else{ $enctype = $self->_maybe_escapeHTML($enctype || &URL_ENCODED); } Thanks, Mike
Thanks for the feedback. Please provide references to RFCs which support your assertions. Assuming your recommendation is in line with the RFCs, a patch would be welcome, preferably in the form of a Github pull request. You'll receive credit in the Changes file for your contribution. Mark
On Wed Aug 15 21:51:07 2012, MARKSTOS wrote: Show quoted text
> Please provide references to RFCs which support your assertions. > Assuming > your recommendation is in line with the RFCs, a patch would be > welcome, preferably in the form of a Github pull request. >
I don't see it in an RFC but on the W3C web site. http://www.w3schools.com/tags/att_form_enctype.asp Note: The enctype attribute can be used only if method="post".
Also at http://www.w3.org/TR/html401/interact/forms.html enctype = content-type [CI]This attribute specifies the content type used to submit the form to the server (when the value of method is "post"). The default value for this attribute is "application/x-www-form-urlencoded". The value "multipart/form-data" should be used in combination with the INPUT element, type="file". This says to me that enctype should not even be specified unless method="post".
This issue has been copied to: https://github.com/leejo/CGI.pm/issues/96 please take all future correspondence there. This ticket will remain open but please do not reply here. This ticket will be closed when the github issue is dealt with.
Rejecting. I'm not accepting any feature requests, patches, or updates to the HTML generating functions of CGI.pm unless they are of a critical nature (i.e. fixing fundamentally broken HTML output).