mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-08-02 11:36:08 -04:00
added autoloading, configurable paste size limit, changed JS to calculate localized comment times instead of UTC
This commit is contained in:
parent
5d6401b44d
commit
edf95ff56d
14 changed files with 207 additions and 91 deletions
|
@ -31,4 +31,23 @@ class filter
|
|||
array_map('filter::stripslashes_deep', $value) :
|
||||
stripslashes($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* format a given number of bytes
|
||||
*
|
||||
* @access public
|
||||
* @static
|
||||
* @param int $size
|
||||
* @return string
|
||||
*/
|
||||
public static function size_humanreadable($size)
|
||||
{
|
||||
$i = 0;
|
||||
$iec = array('B', 'kiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB');
|
||||
while ( ( $size / 1024 ) > 1 ) {
|
||||
$size = $size / 1024;
|
||||
$i++;
|
||||
}
|
||||
return number_format($size, 2, ".", " ") . ' ' . $iec[$i];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue