X-Git-Url: https://git.treefish.org/fex.git/blobdiff_plain/e60096926213ce02293a261254ff065cae44c1c8..20160104:/cgi-bin/pup diff --git a/cgi-bin/pup b/cgi-bin/pup index 241e2d3..a944995 100755 --- a/cgi-bin/pup +++ b/cgi-bin/pup @@ -7,6 +7,8 @@ BEGIN { ($ENV{PERLINIT}||'') =~ /(.+)/s and eval $1 } +use utf8; + # add fex lib (our $FEXLIB) = $ENV{FEXLIB} =~ /(.+)/; die "$0: no $FEXLIB\n" unless -d $FEXLIB; @@ -34,7 +36,7 @@ chdir $spooldir or http_die("$spooldir - $!\n"); my $qs = $ENV{QUERY_STRING}; (my $multi) = $qs =~ s/(^|&)multi//; - + # parse HTTP QUERY_STRING (parameter=value pairs) if ($qs) { foreach (split '&',$qs) { @@ -48,7 +50,7 @@ if ($qs) { ord($1) )); } - setparam($x,$_); + setparam($x,$_); } } } @@ -62,7 +64,7 @@ if ($ENV{REQUEST_METHOD} eq 'POST') { } binmode(STDIN,':raw'); - + READPOST: while (&nvt_read) { if (/^Content-Disposition:\s*form-data;\s*name="([a-z]\w*)"/i) { my $x = $1; @@ -95,7 +97,7 @@ if ($to and $from and checkaddress($from)) { exec($FEXHOME.'/bin/fexsrv') if $ENV{KEEP_ALIVE}; exit; } - + http_header('200 ok'); print html_header($head); @@ -172,11 +174,11 @@ pq(qq( # set parameter variables sub setparam { my ($v,$vv) = @_; - + $v = uc(despace($v)); if ($v eq 'LOCALE' and $vv =~ /^(\w+)$/) { $locale = $1; - } elsif ($v eq 'FROM') { + } elsif ($v eq 'FROM') { $from = normalize_email($vv); } elsif ($v eq 'TO') { $to = normalize_email($vv);