aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp/acp_attachments.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2009-07-11 10:05:20 +0000
committerAndreas Fischer <bantu@phpbb.com>2009-07-11 10:05:20 +0000
commit54ee31972af4f84e09ad5b12ca512e5712bbd87a (patch)
tree6b5963447e5c6f77eda90b735c27a92b2bf76578 /phpBB/includes/acp/acp_attachments.php
parentdfdb78a027ac63ffc337c88453fca364c85f4190 (diff)
downloadforums-54ee31972af4f84e09ad5b12ca512e5712bbd87a.tar
forums-54ee31972af4f84e09ad5b12ca512e5712bbd87a.tar.gz
forums-54ee31972af4f84e09ad5b12ca512e5712bbd87a.tar.bz2
forums-54ee31972af4f84e09ad5b12ca512e5712bbd87a.tar.xz
forums-54ee31972af4f84e09ad5b12ca512e5712bbd87a.zip
Fix bug #47775 - Properly convert and show filesize information
Authorised by: naderman git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9748 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/acp/acp_attachments.php')
-rw-r--r--phpBB/includes/acp/acp_attachments.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php
index de4092036e..0fc0fe0848 100644
--- a/phpBB/includes/acp/acp_attachments.php
+++ b/phpBB/includes/acp/acp_attachments.php
@@ -684,8 +684,9 @@ class acp_attachments
$ext_group_row['max_filesize'] = (int) $config['max_filesize'];
}
- $size_format = ($ext_group_row['max_filesize'] >= 1048576) ? 'mb' : (($ext_group_row['max_filesize'] >= 1024) ? 'kb' : 'b');
- $ext_group_row['max_filesize'] = get_formatted_filesize($ext_group_row['max_filesize'], false);
+ $max_filesize = get_formatted_filesize($ext_group_row['max_filesize'], false, array('mb', 'kb', 'b'));
+ $size_format = $max_filesize['si_identifier'];
+ $ext_group_row['max_filesize'] = $max_filesize['value'];
$img_path = $config['upload_icons_path'];
@@ -1429,8 +1430,9 @@ class acp_attachments
function max_filesize($value, $key = '')
{
// Determine size var and adjust the value accordingly
- $size_var = ($value >= 1048576) ? 'mb' : (($value >= 1024) ? 'kb' : 'b');
- $value = get_formatted_filesize($value, false);
+ $filesize = get_formatted_filesize($value, false, array('mb', 'kb', 'b'));
+ $size_var = $filesize['si_identifier'];
+ $value = $filesize['value'];
return '<input type="text" id="' . $key . '" size="8" maxlength="15" name="config[' . $key . ']" value="' . $value . '" /> <select name="' . $key . '">' . size_select_options($size_var) . '</select>';
}