diff --git a/files/www/cgi-bin/admin b/files/www/cgi-bin/admin index d70ac8e9..4e9e5fea 100755 --- a/files/www/cgi-bin/admin +++ b/files/www/cgi-bin/admin @@ -57,7 +57,7 @@ sub firmware_list_gen $debug = 0; $| = 1; -read_postdata(); +read_postdata({acceptfile => true}); reboot_page("/cgi-bin/status") if $parms{button_reboot}; read_query_string(); $node = nvram_get("node"); diff --git a/files/www/cgi-bin/perlfunc.pm b/files/www/cgi-bin/perlfunc.pm index 52138d9d..305c0552 100644 --- a/files/www/cgi-bin/perlfunc.pm +++ b/files/www/cgi-bin/perlfunc.pm @@ -166,6 +166,7 @@ sub fgets # (from STDIN in method=post form) sub read_postdata { + my ($pdc) = @_; if ( $ENV{REQUEST_METHOD} != "POST" || !$ENV{CONTENT_LENGTH}){ return; }; my ($line, $parm, $file, $handle, $tmp); my $state = "boundary"; @@ -188,7 +189,7 @@ sub read_postdata if(($parm, $file) = $line =~ /^$prefix name="(\w+)"; filename="(.*)"$/) { # file upload $parms{$parm} = $file; - if($file) { $state = "ctype" } + if($file && $pdc->{acceptfile}) { $state = "ctype" } else { $state = "boundary" } } elsif(($parm) = $line =~ /^$prefix name="(\w+)"$/)