diff options
author | Ville Skytt? <ville.skytta@iki.fi> | 2010-12-04 22:28:26 +0200 |
---|---|---|
committer | Ville Skytt? <ville.skytta@iki.fi> | 2010-12-04 22:28:26 +0200 |
commit | 4f405bc38998c9eded33c50fd8f5ff157f15d864 (patch) | |
tree | 7a7e3aa2cc171d58158f618a71ffb8b7f9478a7d | |
parent | e1204954dba25007605edcb069e424c494ec6734 (diff) | |
download | markup-validator-4f405bc38998c9eded33c50fd8f5ff157f15d864.zip markup-validator-4f405bc38998c9eded33c50fd8f5ff157f15d864.tar.gz markup-validator-4f405bc38998c9eded33c50fd8f5ff157f15d864.tar.bz2 |
Handle uploaded_file without Content-Disposition filename as a fragment.
-rwxr-xr-x | httpd/cgi-bin/check | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check index 32216d6..2ef3345 100755 --- a/httpd/cgi-bin/check +++ b/httpd/cgi-bin/check @@ -1903,8 +1903,17 @@ sub handle_file my $q = shift; # The CGI object. my $File = shift; # The master datastructure. + my $p = $q->param('uploaded_file'); my $f = $q->upload('uploaded_file'); - my $h = $q->uploadInfo($q->param('uploaded_file')); + if (!defined($f)) { + + # Probably not an uploaded file as far as CGI is concerned, + # treat as a fragment. + $q->param('fragment', $p); + return &handle_frag($q, $File); + } + + my $h = $q->uploadInfo($p); local $/ = undef; # set line delimiter so that <> reads rest of file my $file = <$f>; @@ -1919,7 +1928,7 @@ sub handle_file $File->{Modified} = $q->http('Last-Modified'); $File->{Server} = $q->http('User-Agent'); # Fake a "server". :-) $File->{Size} = $q->http('Content-Length'); - $File->{URI} = "$f"; + $File->{URI} = "$p"; $File->{'Is Upload'} = TRUE; $File->{'Direct Input'} = FALSE; |