mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
#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
This commit is contained in:
parent
59763841b3
commit
9512b82e1d
1 changed files with 6 additions and 0 deletions
|
@ -236,6 +236,11 @@ function get_formatted_filesize($bytes, $add_size_lang = true)
|
||||||
{
|
{
|
||||||
global $user;
|
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))
|
if ($bytes >= pow(2, 20))
|
||||||
{
|
{
|
||||||
return ($add_size_lang) ? round($bytes / 1024 / 1024, 2) . ' ' . $user->lang['MIB'] : round($bytes / 1024 / 1024, 2);
|
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);
|
$msg_text = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $msg_text);
|
||||||
|
|
||||||
echo '<b>[phpBB Debug] PHP Notice</b>: in file <b>' . $errfile . '</b> on line <b>' . $errline . '</b>: <b>' . $msg_text . '</b><br />' . "\n";
|
echo '<b>[phpBB Debug] PHP Notice</b>: in file <b>' . $errfile . '</b> on line <b>' . $errline . '</b>: <b>' . $msg_text . '</b><br />' . "\n";
|
||||||
|
// echo '<br /><br />BACKTRACE<br />' . get_backtrace() . '<br />' . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue