append .txt if the filename is "-"

This is to allow pastes like `curl -F'file=@-;' https://ls.qorg11.net`
This commit is contained in:
qorg11 2021-10-17 14:47:28 +02:00
parent 20b30be2f5
commit 3f3d173e5d
No known key found for this signature in database
GPG Key ID: 343FC20A4ACA62B9
1 changed files with 3 additions and 1 deletions

View File

@ -74,7 +74,9 @@ if ($filename) {
}
}
if($filename eq "-") {
$filename .= ".txt"; # for pastes
}
if ($allowed_extension) {
open(FILE,">$upload_dir/$dirname/$filename");