if (isset ($_FILES['file']) && is_writable (VAR_FILES)
&& is_writable (VAR_LINKS))
{
+ if (!jirafeau_challenge_upload_ip ($cfg, get_ip_address($cfg)))
+ {
+ echo "Error";
+ exit;
+ }
+
if (jirafeau_has_upload_password ($cfg) &&
(!isset ($_POST['upload_password']) ||
!jirafeau_challenge_upload_password ($cfg, $_POST['upload_password'])))
$res = jirafeau_upload ($_FILES['file'],
isset ($_POST['one_time_download']),
- $key, $time, $_SERVER['REMOTE_ADDR'],
+ $key, $time, get_ip_address($cfg),
$cfg['enable_crypt'], $cfg['link_name_length']);
if (empty($res) || $res['error']['has_error'])
/* Initialize an asynchronous upload. */
elseif (isset ($_GET['init_async']))
{
+ if (!jirafeau_challenge_upload_ip ($cfg, get_ip_address($cfg)))
+ {
+ echo "Error";
+ exit;
+ }
+
if (jirafeau_has_upload_password ($cfg) &&
(!isset ($_POST['upload_password']) ||
!jirafeau_challenge_upload_password ($cfg, $_POST['upload_password'])))
isset ($_POST['one_time_download']),
$key,
$time,
- $_SERVER['REMOTE_ADDR']);
+ get_ip_address($cfg));
}
/* Continue an asynchronous upload. */
elseif (isset ($_GET['push_async']))