Try harder to get people to use a .txt extension, since Firefox insists

on sending application/octet-stream otherwise.

Prodded by: 	sem
This commit is contained in:
Ceri Davies 2007-08-06 12:16:17 +00:00
parent d58098ac2d
commit ad29bd2c03
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/www/; revision=30599
2 changed files with 8 additions and 5 deletions

View file

@ -8,7 +8,7 @@
# GNU General Public License Version 2.
# (http://www.gnu.ai.mit.edu/copyleft/gpl.html)
#
# $FreeBSD: www/en/cgi/dosendpr.cgi,v 1.33 2007/06/12 06:14:34 ceri Exp $
# $FreeBSD: www/en/cgi/dosendpr.cgi,v 1.34 2007/06/12 20:03:05 simon Exp $
use Socket;
use CGI qw/:standard/;
@ -102,9 +102,11 @@ if ($patchhandle = upload('patch')) {
# use bytes;
unless ((uploadInfo($patchhandle)->{'Content-Type'} =~ m!^text/.*!) ||
(uploadInfo($patchhandle)->{'Content-Type'} =~ m!^application/shar$!)) {
&piloterror("Patch file has wrong content type: got " .
&piloterror("<p>Patch file has wrong content type: got " .
uploadInfo($patchhandle)->{'Content-Type'} .
" but was expecting one matching text/.* or application/shar");
" but was expecting one matching text/.* or application/shar.</p>" .
"<p>Try renaming the file to have a .txt extension" .
" to convince your browser to do the right thing.</p>");
}
read($patchhandle,$patchbuf,$maxpatch + 1);
if (length($patchbuf) > $maxpatch) {

View file

@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//FreeBSD//DTD HTML 4.01 Transitional-Based Extension//EN" [
<!ENTITY date "$FreeBSD: www/en/send-pr.sgml,v 1.57 2007/06/12 06:14:34 ceri Exp $">
<!ENTITY date "$FreeBSD: www/en/send-pr.sgml,v 1.58 2007/06/16 07:55:02 simon Exp $">
<!ENTITY title "Submit a FreeBSD problem report">
<!ENTITY copyright "This gnats pr-submission mechanism Copyright &copy; 1996
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.">
@ -143,7 +143,8 @@
<label for="fix">Fix to the problem if known</label>: <br>
<textarea name="fix" id="fix" rows="20" cols="80"></textarea><br><br>
<label for="patch">And/or patch file (100KB max)</label>:
<label for="patch">And/or patch file (100KB max, .txt extension
recommended)</label>:
<input type="file" name="patch" id="patch" maxlength="102400"
accept="text/*" ><br>