if (isset ($_FILES['file']) && is_writable (VAR_FILES)\r
&& is_writable (VAR_LINKS))\r
{\r
- if (strlen ($cfg['upload_password']) > 0 && (!isset ($_POST['upload_password']) || $_POST['upload_password'] != $cfg['upload_password']))\r
+ if (jirafeau_has_upload_password ($cfg) &&\r
+ (!isset ($_POST['upload_password']) ||\r
+ !jirafeau_challenge_upload_password ($cfg, $_POST['upload_password'])))\r
{\r
echo "Error";\r
exit;\r
/* Initialize an asynchronous upload. */\r
elseif (isset ($_GET['init_async']))\r
{\r
- if (strlen ($cfg['upload_password']) > 0 && (!isset ($_POST['upload_password']) || $_POST['upload_password'] != $cfg['upload_password']))\r
+ if (jirafeau_has_upload_password ($cfg) &&\r
+ (!isset ($_POST['upload_password']) ||\r
+ !jirafeau_challenge_upload_password ($cfg, $_POST['upload_password'])))\r
{\r
echo "Error";\r
exit;\r
$type = $_POST['type'];\r
\r
$key = '';\r
- if (isset ($_POST['password']))\r
- $key = $_POST['password'];\r
+ if (isset ($_POST['key']))\r
+ $key = $_POST['key'];\r
\r
$time = time ();\r
if (!isset ($_POST['time']))\r
/* Initialize block. */\r
elseif (isset ($_GET['init_block']) && $cfg['enable_blocks'])\r
{\r
- if (strlen ($cfg['upload_password']) > 0 && (!isset ($_POST['upload_password']) || $_POST['upload_password'] != $cfg['upload_password']))\r
+ if (jirafeau_has_upload_password ($cfg) &&\r
+ (!isset ($_POST['upload_password']) ||\r
+ !jirafeau_challenge_upload_password ($cfg, $_POST['upload_password'])))\r
{\r
echo "Error";\r
exit;\r