From 9512b82e1d2779ab39b46424cd9ad8f4b5f6c0f9 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 18 Apr 2009 18:40:15 +0000 Subject: [PATCH] #43755 - also return GiB sizes for get_formatted_filesize(), patch by nickvergessen git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9474 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 832738395f..be5e661d44 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -236,6 +236,11 @@ function get_formatted_filesize($bytes, $add_size_lang = true) { global $user; + if ($bytes >= pow(2, 30)) + { + return ($add_size_lang) ? round($bytes / 1024 / 1024 / 1024, 2) . ' ' . $user->lang['GIB'] : round($bytes / 1024 / 1024 / 1024, 2); + } + if ($bytes >= pow(2, 20)) { return ($add_size_lang) ? round($bytes / 1024 / 1024, 2) . ' ' . $user->lang['MIB'] : round($bytes / 1024 / 1024, 2); @@ -3240,6 +3245,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline) $msg_text = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $msg_text); echo '[phpBB Debug] PHP Notice: in file ' . $errfile . ' on line ' . $errline . ': ' . $msg_text . '
' . "\n"; + // echo '

BACKTRACE
' . get_backtrace() . '
' . "\n"; } return;