1
0
mirror of https://github.com/Rouji/single_php_filehost.git synced 2025-04-04 16:39:34 +00:00

Return early on move_uploaded_files() error

This commit is contained in:
mul91n 2021-08-14 15:30:48 +10:00
parent 1c7d3d2abc
commit 68d8c33687

View File

@ -147,8 +147,13 @@ function store_file($name, $tmpfile, $formatted = false)
}
$res = move_uploaded_file($tmpfile, $target_file);
if ($res)
if (!$res)
{
//TODO: proper error handling?
header("HTTP/1.0 520 Unknown Error");
return;
}
if ($EXTERNAL_HOOK !== null)
{
putenv("REMOTE_ADDR=".$_SERVER['REMOTE_ADDR']);
@ -194,12 +199,6 @@ function store_file($name, $tmpfile, $formatted = false)
FILE_APPEND
);
}
}
else
{
//TODO: proper error handling?
header("HTTP/1.0 520 Unknown Error");
}
}
// purge all files older than their retention period allows.