X-Git-Url: https://git.p6c8.net/jirafeau_project.git/blobdiff_plain/6b28d8973d9d57cae8a4d1f52ec5556cbfce1840..0e5cca951eafa6193153f171b89a3bbf255152ef:/lib/functions.php?ds=sidebyside diff --git a/lib/functions.php b/lib/functions.php index a8851aa..bc119a3 100755 --- a/lib/functions.php +++ b/lib/functions.php @@ -122,10 +122,11 @@ function jirafeau_clean_rm_file ($md5) { $p = s2p ("$md5"); - if (file_exists (VAR_FILES . $p . $md5)) - unlink (VAR_FILES . $p . $md5); - if (file_exists (VAR_FILES . $p . $md5 . '_count')) - unlink (VAR_FILES . $p . $md5 . '_count'); + $f = VAR_FILES . $p . $md5; + if (file_exists ($f) && is_file ($f)) + unlink ($f); + if (file_exists ($f . '_count') && is_file ($f . '_count')) + unlink ($f . '_count'); $parse = VAR_FILES . $p; $scan = array(); while (file_exists ($parse) @@ -388,7 +389,7 @@ jirafeau_upload ($file, $one_time_download, $key, $time, $ip, $crypt, $link_name $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 . @@ -514,12 +515,6 @@ function check_errors () if (!is_writable (VAR_BLOCK)) add_error (t('The block directory is not writable!'), VAR_BLOCK); - - /* Check if the install.php script is still in the directory. */ - if (file_exists (JIRAFEAU_ROOT . 'install.php')) - add_error (t('Installer script still present'), - t('Please make sure to delete the installer script ' . - '"install.php" before continuing.')); } /** @@ -904,7 +899,7 @@ jirafeau_async_end ($ref, $code, $crypt, $link_name_length) $crypt_key = ''; if ($crypt == true && extension_loaded('mcrypt')) { - $cypt_key = jirafeau_encrypt_file ($p, $p); + $crypt_key = jirafeau_encrypt_file ($p, $p); if (strlen($crypt_key) > 0) $crypted = true; } @@ -933,7 +928,7 @@ jirafeau_async_end ($ref, $code, $crypt, $link_name_length) 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 .