Merge branch 'hotfix-3.16.1.1'

This commit is contained in:
Conrad Lara - KG6JEI 2017-04-12 19:57:52 -07:00
commit d01256bbd0
2 changed files with 3 additions and 2 deletions

View File

@ -57,7 +57,7 @@ sub firmware_list_gen
$debug = 0; $debug = 0;
$| = 1; $| = 1;
read_postdata(); read_postdata({acceptfile => true});
read_query_string(); read_query_string();
$node = nvram_get("node"); $node = nvram_get("node");
$tmpdir = "/tmp/web/admin"; $tmpdir = "/tmp/web/admin";

View File

@ -165,6 +165,7 @@ sub fgets
# (from STDIN in method=post form) # (from STDIN in method=post form)
sub read_postdata sub read_postdata
{ {
my ($pdc) = @_;
if ( $ENV{REQUEST_METHOD} != "POST" || !$ENV{CONTENT_LENGTH}){ return; }; if ( $ENV{REQUEST_METHOD} != "POST" || !$ENV{CONTENT_LENGTH}){ return; };
my ($line, $parm, $file, $handle, $tmp); my ($line, $parm, $file, $handle, $tmp);
my $state = "boundary"; my $state = "boundary";
@ -187,7 +188,7 @@ sub read_postdata
if(($parm, $file) = $line =~ /^$prefix name="(\w+)"; filename="(.*)"$/) if(($parm, $file) = $line =~ /^$prefix name="(\w+)"; filename="(.*)"$/)
{ # file upload { # file upload
$parms{$parm} = $file; $parms{$parm} = $file;
if($file) { $state = "ctype" } if($file && $pdc->{acceptfile}) { $state = "ctype" }
else { $state = "boundary" } else { $state = "boundary" }
} }
elsif(($parm) = $line =~ /^$prefix name="(\w+)"$/) elsif(($parm) = $line =~ /^$prefix name="(\w+)"$/)