diff options
| author | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-02-18 15:26:38 +0000 | 
|---|---|---|
| committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-02-18 15:26:38 +0000 | 
| commit | dc59ad1784d0591488d794be63014e47a834ed12 (patch) | |
| tree | 0cf0ff1e41f966bf5864dd079ea07f44aa2fbf97 /scripts/multipart | |
| parent | cvs version (diff) | |
| download | w3m-dc59ad1784d0591488d794be63014e47a834ed12.tar.gz w3m-dc59ad1784d0591488d794be63014e47a834ed12.zip | |
[w3m-dev 03753] Fixed multipart.cgi
* scripts/multipart/multipart.cgi.in: remove w3m-control
		use input hidden
		add form_encode
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to 'scripts/multipart')
| -rw-r--r-- | scripts/multipart/multipart.cgi.in | 23 | 
1 files changed, 20 insertions, 3 deletions
| diff --git a/scripts/multipart/multipart.cgi.in b/scripts/multipart/multipart.cgi.in index 1dd981a..db8001c 100644 --- a/scripts/multipart/multipart.cgi.in +++ b/scripts/multipart/multipart.cgi.in @@ -77,7 +77,11 @@ if (defined($v{'count'})) {  			$_ = &decode($_, $MIME_DECODE);  		}  		if (s/^(\S+)\s*:\s*//) { -			$hbody .= "$&$_\n"; +			$h = $&; +			if ($h =~ /^w3m-control/i) { +				$h = "WARNING: $h"; +			} +			$hbody .= "$h$_\n";  			$p = $1;  			$p =~ tr/A-Z/a-z/;  			$header{$p} = $_; @@ -192,9 +196,16 @@ while(! $end) {  		} else {  			$name = "Content";  		} -		print "<form action=\"$qcgi?file=$qfile&boundary=$qboundary&count=$count\">\n"; +		print "<form action=\"$qcgi\">\n"; +		print "<input type=hidden name=file value=\"$qfile\">\n"; +		print "<input type=hidden name=boundary value=\"$qboundary\">\n"; +		print "<input type=hidden name=count value=\"$count\">\n";  		if ($image) { -			print "<input type=image name=submit src=\"$qcgi?file=$qfile&boundary=$qboundary&count=$count\" alt=\"", +			print "<input type=image name=submit src=\"$qcgi?file=", +				&html_quote(&form_encode($file)), +				"&boundary=", +				&html_quote(&form_encode($boundary)), +				"&count=$count\" alt=\"",  				&html_quote($name), "\">\n";  		} else {  			print "<input type=submit name=submit value=\"", @@ -268,6 +279,12 @@ sub form_decode {    return $_;  } +sub form_encode { +  local($_) = @_; +  s/[\000-\040\+:#?&%<>"\177-\377]/sprintf('%%%02X', unpack('C', $&))/eg; +  return $_; +} +  sub guess_type {  	local($_) = @_; | 
