X-Git-Url: https://git.p6c8.net/jirafeau.git/blobdiff_plain/092766a37489a5e38285c256f387af2bba7c5e95..4dc05368251f5bb89a2780f5b1a4bd1866369bdd:/lib/functions.php?ds=inline diff --git a/lib/functions.php b/lib/functions.php index 5f43066..53733ca 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -192,12 +192,16 @@ function jirafeau_ini_to_bytes($value) switch (strtoupper($modifier)) { case 'P': $bytes *= 1024; + // no break case 'T': $bytes *= 1024; + // no break case 'G': $bytes *= 1024; + // no break case 'M': $bytes *= 1024; + // no break case 'K': $bytes *= 1024; } @@ -210,8 +214,10 @@ function jirafeau_ini_to_bytes($value) */ function jirafeau_get_max_upload_size_bytes() { - return min(jirafeau_ini_to_bytes(ini_get('post_max_size')), - jirafeau_ini_to_bytes(ini_get('upload_max_filesize'))); + return min( + jirafeau_ini_to_bytes(ini_get('post_max_size')), + jirafeau_ini_to_bytes(ini_get('upload_max_filesize')) + ); } /** @@ -459,10 +465,12 @@ function jirafeau_upload($file, $one_time_download, $key, $time, $ip, $crypt, $l /* create link file */ $link_tmp_name = VAR_LINKS . $hash . rand(0, 10000) . '.tmp'; $handle = fopen($link_tmp_name, 'w'); - fwrite($handle, - $name . NL. $mime_type . NL. $size . NL. $password . NL. $time . + fwrite( + $handle, + $name . NL. $mime_type . NL. $size . NL. $password . NL. $time . NL . $hash. NL . ($one_time_download ? 'O' : 'R') . NL . time() . - NL . $ip . NL. $delete_link_code . NL . ($crypted ? 'C' : 'O')); + NL . $ip . NL. $delete_link_code . NL . ($crypted ? 'C' : 'O') + ); fclose($handle); $hash_link = substr(base_16_to_64(md5_file($link_tmp_name)), 0, $link_name_length); $l = s2p("$hash_link"); @@ -627,15 +635,9 @@ function jirafeau_admin_list($name, $file_hash, $link_hash) echo t('LS_FILES'); } echo ''; - echo '
' . t('FILENAME') . ' | '; - echo '' . t('TYPE') . ' | '; - echo '' . t('SIZE') . ' | '; - echo '' . t('EXPIRE') . ' | '; - echo '' . t('ONETIME') . ' | '; - echo '' . t('UPLOAD_DATE') . ' | '; - echo '' . t('ORIGIN') . ' | '; + echo ''; echo ' | ' . t('ACTION') . ' | '; echo '
---|---|---|---|---|---|---|---|---|
' . '' . jirafeau_escape($l['file_name']) . ''; - echo ' | '; - echo '' . jirafeau_escape($l['mime_type']) . ' | '; - echo '' . jirafeau_human_size($l['file_size']) . ' | '; - echo '' . ($l['time'] == -1 ? 'â' : jirafeau_get_datetimefield($l['time'])) . ' | '; - echo '';
- if ($l['onetime'] == 'O') {
- echo 'Y';
- } else {
- echo 'N';
+ t('DL_PAGE') . '">' . jirafeau_escape($l['file_name']) . ' '; + echo t('TYPE') . ': ' . jirafeau_escape($l['mime_type']) . ' '; + echo t('SIZE') . ': ' . jirafeau_human_size($l['file_size']) . ' '; + echo t('EXPIRE') . ': ' . ($l['time'] == -1 ? 'â' : jirafeau_get_datetimefield($l['time'])) . ' '; + echo t('ONETIME') . ': ' . ($l['onetime'] == 'O' ? 'Yes' : 'No') . ' '; + echo t('UPLOAD_DATE') . ': ' . jirafeau_get_datetimefield($l['upload_date']) . ' '; + if (strlen($l['ip']) > 0) { + echo t('ORIGIN') . ': ' . $l['ip'] . ' '; } - echo ' | ';
- echo '' . jirafeau_get_datetimefield($l['upload_date']) . ' | '; - echo '' . $l['ip'] . ' | '; - echo '' . - ' | '; + echo ' |