function
jirafeau_upload ($file, $one_time_download, $key, $time, $ip, $crypt, $link_name_length)
{
+ if (!is_int ($link_name_length))
+ $link_name_length = 8;
if (empty ($file['tmp_name']) || !is_uploaded_file ($file['tmp_name']))
{
return (array(
$password = md5 ($key);
/* create link file */
- $link_tmp_name = VAR_LINKS . $md5 . rand (0, 10000) . ' .tmp';
+ $link_tmp_name = VAR_LINKS . $md5 . rand (0, 10000) . '.tmp';
$handle = fopen ($link_tmp_name, 'w');
fwrite ($handle,
$name . NL. $mime_type . NL. $size . NL. $password . NL. $time .
'link' =>'',
'delete_link' => ''));
}
- return (array ('error' => $noerr,
- 'link' => $md5_link,
- 'delete_link' => $delete_link_code,
- 'crypt_key' => $crypt_key));
+ return (array ('error' => $noerr,
+ 'link' => $md5_link,
+ 'delete_link' => $delete_link_code,
+ 'crypt_key' => $crypt_key));
}
/**
function
jirafeau_async_end ($ref, $code, $crypt, $link_name_length)
{
+ if (!is_int ($link_name_length))
+ $link_name_length = 8;
/* Get async infos. */
$a = jirafeau_get_async_ref ($ref);
if (count ($a) == 0
fclose ($handle);
/* Create link. */
- $link_tmp_name = VAR_LINKS . $md5 . rand (0, 10000) . ' .tmp';
+ $link_tmp_name = VAR_LINKS . $md5 . rand (0, 10000) . '.tmp';
$handle = fopen ($link_tmp_name, 'w');
fwrite ($handle,
$a['file_name'] . NL . $a['mime_type'] . NL . $size . NL .