Reject invalid uploads and expand flow tests.

This commit is contained in:
tim
2026-09-26 15:27:51 +02:00
parent 716a609f4e
commit 8f4851e576
9 changed files with 427 additions and 11 deletions
+2 -2
View File
@@ -7,8 +7,8 @@ echo '<p>Please review your submission. Once you\'ve finished, please click "Sub
// Keep a new image outside the web root until the story is saved;
// display.php shows it to this session only. A request that failed the
// captcha or the form token keeps nothing.
if (is_uploaded_file($_FILES['upload']['tmp_name'] ?? '') &&
!isset($validate['upload']) && !isset($validate['captcha']) && !isset($validate['csrf'])) {
if (!isset($validate['upload']) && !isset($validate['captcha']) && !isset($validate['csrf']) &&
is_string($_FILES['upload']['tmp_name'] ?? '') && is_uploaded_file($_FILES['upload']['tmp_name'] ?? '')) {
if (store_upload($_FILES['upload']['tmp_name']))
$file_src = pending_upload_url();
else