X-Git-Url: https://git.p6c8.net/jirafeau.git/blobdiff_plain/8d0d50765bc4cd7b98fc28dbccbf4284d034d466..9fb59d5f9af3618e443aba9cc459f4bc682ccceb:/script.php?ds=sidebyside diff --git a/script.php b/script.php index b6fa71f..19f14a8 100755 --- a/script.php +++ b/script.php @@ -263,6 +263,12 @@ if (has_error ()) if (isset ($_FILES['file']) && is_writable (VAR_FILES) && is_writable (VAR_LINKS)) { + if (strlen ($cfg['upload_password']) > 0 && (!isset ($_POST['upload_password']) || $_POST['upload_password'] != $cfg['upload_password'])) + { + echo "Error"; + exit; + } + $key = ''; if (isset ($_POST['key'])) $key = $_POST['key']; @@ -523,6 +529,12 @@ fi /* Initialize an asynchronous upload. */ elseif (isset ($_GET['init_async'])) { + if (strlen ($cfg['upload_password']) > 0 && (!isset ($_POST['upload_password']) || $_POST['upload_password'] != $cfg['upload_password'])) + { + echo "Error"; + exit; + } + if (!isset ($_POST['filename'])) { echo "Error"; @@ -591,6 +603,12 @@ elseif (isset ($_GET['end_async'])) /* Initialize block. */ elseif (isset ($_GET['init_block']) && $cfg['enable_blocks']) { + if (strlen ($cfg['upload_password']) > 0 && (!isset ($_POST['upload_password']) || $_POST['upload_password'] != $cfg['upload_password'])) + { + echo "Error"; + exit; + } + if (!isset ($_POST['size'])) echo "Error"; else