X-Git-Url: https://git.p6c8.net/jirafeau.git/blobdiff_plain/1203cc4e9094fa86f7978c9da56f454d4c21ca32..dddcc255110ee8219bfb41943c6e4430a02139aa:/lib/functions.php?ds=sidebyside diff --git a/lib/functions.php b/lib/functions.php index 34c7df8..b3dc904 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'; - } - echo ' | '; - echo '' . jirafeau_get_datetimefield($l['upload_date']) . ' | '; - echo '' . $l['ip'] . ' | '; - echo '' . - ' | '; + echo ' |