aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_upload.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/functions_upload.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/functions_upload.php')
-rw-r--r--phpBB/includes/functions_upload.php9
1 files changed, 3 insertions, 6 deletions
diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php
index 1ad6223aa1..c65d732984 100644
--- a/phpBB/includes/functions_upload.php
+++ b/phpBB/includes/functions_upload.php
@@ -417,10 +417,9 @@ class filespec
// Filesize is too big or it's 0 if it was larger than the maxsize in the upload form
if ($this->upload->max_filesize && ($this->get('filesize') > $this->upload->max_filesize || $this->filesize == 0))
{
- $size_lang = ($this->upload->max_filesize >= 1048576) ? $user->lang['MIB'] : (($this->upload->max_filesize >= 1024) ? $user->lang['KIB'] : $user->lang['BYTES'] );
$max_filesize = get_formatted_filesize($this->upload->max_filesize, false);
- $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'WRONG_FILESIZE'], $max_filesize, $size_lang);
+ $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'WRONG_FILESIZE'], $max_filesize['value'], $max_filesize['unit']);
return false;
}
@@ -855,10 +854,9 @@ class fileupload
break;
case 2:
- $size_lang = ($this->max_filesize >= 1048576) ? $user->lang['MIB'] : (($this->max_filesize >= 1024) ? $user->lang['KIB'] : $user->lang['BYTES']);
$max_filesize = get_formatted_filesize($this->max_filesize, false);
- $error = sprintf($user->lang[$this->error_prefix . 'WRONG_FILESIZE'], $max_filesize, $size_lang);
+ $error = sprintf($user->lang[$this->error_prefix . 'WRONG_FILESIZE'], $max_filesize['value'], $max_filesize['unit']);
break;
case 3:
@@ -891,10 +889,9 @@ class fileupload
// Filesize is too big or it's 0 if it was larger than the maxsize in the upload form
if ($this->max_filesize && ($file->get('filesize') > $this->max_filesize || $file->get('filesize') == 0))
{
- $size_lang = ($this->max_filesize >= 1048576) ? $user->lang['MIB'] : (($this->max_filesize >= 1024) ? $user->lang['KIB'] : $user->lang['BYTES']);
$max_filesize = get_formatted_filesize($this->max_filesize, false);
- $file->error[] = sprintf($user->lang[$this->error_prefix . 'WRONG_FILESIZE'], $max_filesize, $size_lang);
+ $file->error[] = sprintf($user->lang[$this->error_prefix . 'WRONG_FILESIZE'], $max_filesize['value'], $max_filesize['unit']);
}
// check Filename