Check that uploaded file has a filename

This commit is contained in:
Jamie Cameron
2025-10-14 14:05:10 -07:00
parent 2acfc37745
commit cb5f4e9d39
2 changed files with 3 additions and 1 deletions

View File

@@ -319,6 +319,7 @@ progress_incache=Found $1 in cache ..
readparse_cdheader=Missing Content-Disposition header
readparse_enc=Expecting form-data encoding, but got normal encoding
readparse_max=Data exceeded maximum size of $1 bytes
readparse_nofile=Missing filename for upload
password_expired=Your password has expired, and a new one must be chosen.
password_temp=You must select a new password to replace your temporary login.

View File

@@ -855,10 +855,11 @@ while(1) {
my $data = "";
my $dfile;
my $fh;
if ($direct_dir && $file) {
if ($direct_dir) {
# Save directly to disk
$file =~ /([^\\\/]+)$/;
my $filename = $1;
$filename || &error($text{'readparse_nofile'});
my $uppath = "$direct_dir/$filename";
open($fh, ">", $uppath) || next;
# Return file name, no data