X-Git-Url: https://git.p6c8.net/jirafeau.git/blobdiff_plain/218767ef1f78a6ba2ae62039f3a65d296d361930..0f7a80a504383a272ecde46a30f4698da20c5924:/lib/functions.php?ds=inline diff --git a/lib/functions.php b/lib/functions.php index aaa0daf..5c0c45f 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -56,7 +56,7 @@ base_16_to_64 ($num) '1101', # d '1110', # e '1111'); # f - $o = ''; + $o = ''; $b = ''; $i = 0; # Convert long hex string to bin. @@ -114,7 +114,7 @@ jirafeau_human_size ($octets) $p = min (floor (($o ? log ($o) : 0) / log (1024)), count ($u) - 1); $o /= pow (1024, $p); return round ($o, 1) . $u[$p]; -} +} function jirafeau_clean_rm_link ($link) @@ -127,7 +127,7 @@ jirafeau_clean_rm_link ($link) while (file_exists ($parse) && ($scan = scandir ($parse)) && count ($scan) == 2 // '.' and '..' folders => empty. - && basename ($parse) != basename (VAR_LINKS)) + && basename ($parse) != basename (VAR_LINKS)) { rmdir ($parse); $parse = substr ($parse, 0, strlen($parse) - strlen(basename ($parse)) - 1); @@ -148,7 +148,7 @@ jirafeau_clean_rm_file ($md5) while (file_exists ($parse) && ($scan = scandir ($parse)) && count ($scan) == 2 // '.' and '..' folders => empty. - && basename ($parse) != basename (VAR_FILES)) + && basename ($parse) != basename (VAR_FILES)) { rmdir ($parse); $parse = substr ($parse, 0, strlen($parse) - strlen(basename ($parse)) - 1); @@ -284,7 +284,7 @@ jirafeau_delete_file ($md5) if (strcmp ($node, '.') == 0 || strcmp ($node, '..') == 0 || preg_match ('/\.tmp/i', "$node")) continue; - + if (is_dir ($d . $node)) { /* Push new found directory. */ @@ -300,7 +300,7 @@ jirafeau_delete_file ($md5) { $count++; jirafeau_delete_link ($node); - } + } } } } @@ -413,7 +413,7 @@ jirafeau_upload ($file, $one_time_download, $key, $time, $ip, $crypt, $link_name { if (file_exists ($link_tmp_name)) unlink ($link_tmp_name); - + $counter--; if ($counter >= 1) { @@ -506,7 +506,7 @@ function check_errors ($cfg) if (file_exists (JIRAFEAU_ROOT . 'install.php') && !($cfg['installation_done'] === true)) { - header('Location: install.php'); + header('Location: install.php'); exit; } @@ -519,7 +519,7 @@ function check_errors ($cfg) if (!is_writable (VAR_LINKS)) add_error (t('The link directory is not writable!'), VAR_LINKS); - + if (!is_writable (VAR_ASYNC)) add_error (t('The async directory is not writable!'), VAR_ASYNC); } @@ -536,7 +536,7 @@ jirafeau_get_link ($hash) if (!file_exists ($link)) return $out; - + $c = file ($link); $out['file_name'] = trim ($c[0]); $out['mime_type'] = trim ($c[1]); @@ -549,7 +549,7 @@ jirafeau_get_link ($hash) $out['ip'] = trim ($c[8]); $out['link_code'] = trim ($c[9]); $out['crypted'] = trim ($c[10]) == 'C'; - + return $out; } @@ -613,21 +613,28 @@ jirafeau_admin_list ($name, $file_hash, $link_hash) /* Print link informations. */ echo '