Skip to content
Snippets Groups Projects
Commit caefac39 authored by Peter Rotich's avatar Peter Rotich
Browse files

Use human readable file size

parent af0e9f80
No related branches found
No related tags found
No related merge requests found
...@@ -138,8 +138,8 @@ class osTicket { ...@@ -138,8 +138,8 @@ class osTicket {
if(!$this->isFileTypeAllowed($file)) if(!$this->isFileTypeAllowed($file))
$file['error']='Invalid file type for '.$file['name']; $file['error']='Invalid file type for '.$file['name'];
elseif($file['size']>$this->getConfig()->getMaxFileSize()) elseif($file['size']>$this->getConfig()->getMaxFileSize())
$file['error']=sprintf('File (%s) is too big. Maximum of %s bytes allowed', $file['error']=sprintf('File (%s) is too big. Maximum of %s allowed',
$file['name'], $this->getConfig()->getMaxFileSize()); $file['name'], Format::file_size($this->getConfig()->getMaxFileSize()));
elseif(!$file['error'] && !is_uploaded_file($file['tmp_name'])) elseif(!$file['error'] && !is_uploaded_file($file['tmp_name']))
$file['error']='Invalid or bad upload POST'; $file['error']='Invalid or bad upload POST';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment