[w3m-dev 02840]
* scripts/w3mmail.cgi.in: use LOCAL_COOKIE * scripts/w3mmail.cgi.in: no need HTTP response header * scripts/w3mmail.cgi.in: fix typo $nkf_NKF * scripts/w3mmail.cgi.in: eval { use NKF; } is perl5ism * scripts/multipart/multipart.cgi.in: ditto From: Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
This commit is contained in:
11
ChangeLog
11
ChangeLog
@@ -1,3 +1,12 @@
|
|||||||
|
2002-01-16 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
|
||||||
|
|
||||||
|
* [w3m-dev 02840]
|
||||||
|
* scripts/w3mmail.cgi.in: use LOCAL_COOKIE
|
||||||
|
* scripts/w3mmail.cgi.in: no need HTTP response header
|
||||||
|
* scripts/w3mmail.cgi.in: fix typo $nkf_NKF
|
||||||
|
* scripts/w3mmail.cgi.in: eval { use NKF; } is perl5ism
|
||||||
|
* scripts/multipart/multipart.cgi.in: ditto
|
||||||
|
|
||||||
2002-01-16 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
|
2002-01-16 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
|
||||||
|
|
||||||
* [w3m-dev 02835]
|
* [w3m-dev 02835]
|
||||||
@@ -1949,4 +1958,4 @@
|
|||||||
* release-0-2-1
|
* release-0-2-1
|
||||||
* import w3m-0.2.1
|
* import w3m-0.2.1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.220 2002/01/15 16:07:58 ukai Exp $
|
$Id: ChangeLog,v 1.221 2002/01/15 16:13:39 ukai Exp $
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#!@PERL@
|
#!@PERL@
|
||||||
|
|
||||||
eval { use NKF; };
|
eval "use NKF;";
|
||||||
if (! $@) {
|
if (! $@) {
|
||||||
$use_NKF = 1;
|
$use_NKF = 1;
|
||||||
$CONV = "-e";
|
$CONV = "-e";
|
||||||
|
@@ -1,10 +1,11 @@
|
|||||||
#!@PERL@
|
#!@PERL@
|
||||||
|
|
||||||
$rcsid = q$Id: w3mmail.cgi.in,v 1.1 2002/01/15 05:36:24 ukai Exp $;
|
$rcsid = q$Id: w3mmail.cgi.in,v 1.2 2002/01/15 16:13:39 ukai Exp $;
|
||||||
($id = $rcsid) =~ s/^.*,v ([\d\.]*).*/$1/;
|
($id = $rcsid) =~ s/^.*,v ([\d\.]*).*/$1/;
|
||||||
($prog=$0) =~ s/.*\///;
|
($prog=$0) =~ s/.*\///;
|
||||||
|
|
||||||
$query = $ENV{'QUERY_STRING'};
|
$query = $ENV{'QUERY_STRING'};
|
||||||
|
$local_cookie = $ENV{'LOCAL_COOKIE'};
|
||||||
$url = $query;
|
$url = $query;
|
||||||
$SENDMAIL = '/usr/lib/sendmail';
|
$SENDMAIL = '/usr/lib/sendmail';
|
||||||
$SENDMAIL = '/usr/sbin/sendmail' if -x '/usr/sbin/sendmail';
|
$SENDMAIL = '/usr/sbin/sendmail' if -x '/usr/sbin/sendmail';
|
||||||
@@ -26,7 +27,6 @@ if ($query =~ s/^\w+://) {
|
|||||||
$body = $opt{'body'};
|
$body = $opt{'body'};
|
||||||
delete $opt{'body'};
|
delete $opt{'body'};
|
||||||
|
|
||||||
print "200 HTTP/1.0 OK\r\n";
|
|
||||||
print "Content-Type: text/html\r\n";
|
print "Content-Type: text/html\r\n";
|
||||||
print "w3m-control: END\r\n";
|
print "w3m-control: END\r\n";
|
||||||
print "w3m-control: PREV_LINK\r\n";
|
print "w3m-control: PREV_LINK\r\n";
|
||||||
@@ -35,6 +35,7 @@ if ($query =~ s/^\w+://) {
|
|||||||
print "<body><h1>W3M Mailer: $qurl</h1>\n";
|
print "<body><h1>W3M Mailer: $qurl</h1>\n";
|
||||||
print "<form action='$0' method='POST'>\n";
|
print "<form action='$0' method='POST'>\n";
|
||||||
print "<input type='hidden' name='action' value='preview'>\n";
|
print "<input type='hidden' name='action' value='preview'>\n";
|
||||||
|
print "<input type='hidden' name='cookie' value='$local_cookie'>\n";
|
||||||
print "<table border='1'>\n";
|
print "<table border='1'>\n";
|
||||||
if ($opt{'from'}) {
|
if ($opt{'from'}) {
|
||||||
print "<tr><th>From:</th><td>" . &html_quote($opt{'from'})
|
print "<tr><th>From:</th><td>" . &html_quote($opt{'from'})
|
||||||
@@ -69,9 +70,15 @@ if ($query =~ s/^\w+://) {
|
|||||||
print "</body></html>\n";
|
print "</body></html>\n";
|
||||||
exit(0);
|
exit(0);
|
||||||
} else {
|
} else {
|
||||||
print "200 HTTP/1.0 OK\r\n";
|
|
||||||
sysread(STDIN, $req, $ENV{'CONTENT_LENGTH'});
|
sysread(STDIN, $req, $ENV{'CONTENT_LENGTH'});
|
||||||
%opt = &parse_opt($req);
|
%opt = &parse_opt($req);
|
||||||
|
if ($local_cookie ne $opt{'cookie'}) {
|
||||||
|
print "Content-Type: text/plain\r\n";
|
||||||
|
print "\r\n";
|
||||||
|
print "Local cookie doesn't match: It may be an illegal execution\n";
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
|
delete $opt{'cookie'};
|
||||||
$body = &html_quote($opt{'body'});
|
$body = &html_quote($opt{'body'});
|
||||||
delete $opt{'body'};
|
delete $opt{'body'};
|
||||||
$act = $opt{'action'};
|
$act = $opt{'action'};
|
||||||
@@ -87,6 +94,7 @@ if ($query =~ s/^\w+://) {
|
|||||||
print "<h1>W3M Mailer: preview</h1>\n";
|
print "<h1>W3M Mailer: preview</h1>\n";
|
||||||
print "<form action='$0' method='POST'>\n";
|
print "<form action='$0' method='POST'>\n";
|
||||||
print "<input type='hidden' name='action' value='send'>\n";
|
print "<input type='hidden' name='action' value='send'>\n";
|
||||||
|
print "<input type='hidden' name='cookie' value='$local_cookie'>\n";
|
||||||
print "<hr>\n";
|
print "<hr>\n";
|
||||||
print "<pre>\n";
|
print "<pre>\n";
|
||||||
foreach $h (keys %opt) {
|
foreach $h (keys %opt) {
|
||||||
@@ -116,7 +124,6 @@ if ($query =~ s/^\w+://) {
|
|||||||
print "</body></html>\n";
|
print "</body></html>\n";
|
||||||
} else {
|
} else {
|
||||||
unless (open(MAIL, "|$SENDMAIL -t")) {
|
unless (open(MAIL, "|$SENDMAIL -t")) {
|
||||||
print "200 HTTP/1.0 OK\r\n";
|
|
||||||
print "Content-Type: text/html\r\n";
|
print "Content-Type: text/html\r\n";
|
||||||
print "\r\n";
|
print "\r\n";
|
||||||
print "<html><head><title>W3M Mailer</title></head>\n";
|
print "<html><head><title>W3M Mailer</title></head>\n";
|
||||||
@@ -144,7 +151,6 @@ if ($query =~ s/^\w+://) {
|
|||||||
print "w3m-control: BACK\r\n";
|
print "w3m-control: BACK\r\n";
|
||||||
print "\r\n";
|
print "\r\n";
|
||||||
} else {
|
} else {
|
||||||
print "200 HTTP/1.0 OK\r\n";
|
|
||||||
print "Content-Type: text/html\r\n";
|
print "Content-Type: text/html\r\n";
|
||||||
print "\r\n";
|
print "\r\n";
|
||||||
print "<html><head><title>W3M Mailer</title></head>\n";
|
print "<html><head><title>W3M Mailer</title></head>\n";
|
||||||
@@ -158,11 +164,11 @@ if ($query =~ s/^\w+://) {
|
|||||||
sub lang_setup {
|
sub lang_setup {
|
||||||
$lang = $ENV{'LANG'};
|
$lang = $ENV{'LANG'};
|
||||||
if ($lang =~ /^ja/i) {
|
if ($lang =~ /^ja/i) {
|
||||||
eval { use NKF; };
|
eval "use NKF;";
|
||||||
if (! $@) {
|
if (! $@) {
|
||||||
$use_NKF = 1;
|
$use_NKF = 1;
|
||||||
} else {
|
} else {
|
||||||
$nkf_NKF = 0;
|
$use_NKF = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user