X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/blobdiff_plain/a6c1ba9e0d7305fc75eb216d1646d5a59d044986..6c49ea194c030a04ce8b303aae2a51dce01c7382:/script.php?ds=sidebyside diff --git a/script.php b/script.php index 3185de7..d109d4a 100644 --- a/script.php +++ b/script.php @@ -263,7 +263,9 @@ 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'])) + if (jirafeau_has_upload_password ($cfg) && + (!isset ($_POST['upload_password']) || + !jirafeau_challenge_upload_password ($cfg, $_POST['upload_password']))) { echo "Error"; exit; @@ -529,7 +531,9 @@ 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'])) + if (jirafeau_has_upload_password ($cfg) && + (!isset ($_POST['upload_password']) || + !jirafeau_challenge_upload_password ($cfg, $_POST['upload_password']))) { echo "Error"; exit; @@ -546,8 +550,8 @@ elseif (isset ($_GET['init_async'])) $type = $_POST['type']; $key = ''; - if (isset ($_POST['password'])) - $key = $_POST['password']; + if (isset ($_POST['key'])) + $key = $_POST['key']; $time = time (); if (!isset ($_POST['time'])) @@ -603,7 +607,9 @@ 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'])) + if (jirafeau_has_upload_password ($cfg) && + (!isset ($_POST['upload_password']) || + !jirafeau_challenge_upload_password ($cfg, $_POST['upload_password']))) { echo "Error"; exit;