mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 12:28:52 +00:00
[ticket/11192] Mark negative byte numbers as unsupported.
PHPBB3-11192
This commit is contained in:
parent
4e3a42f59f
commit
7cbd440e7a
2 changed files with 1 additions and 17 deletions
|
@ -289,7 +289,7 @@ function phpbb_gmgetdate($time = false)
|
||||||
/**
|
/**
|
||||||
* Return formatted string for filesizes
|
* Return formatted string for filesizes
|
||||||
*
|
*
|
||||||
* @param int $value filesize in bytes
|
* @param int $value filesize in bytes (non-negative number)
|
||||||
* @param bool $string_only true if language string should be returned
|
* @param bool $string_only true if language string should be returned
|
||||||
* @param array $allowed_units only allow these units (data array indexes)
|
* @param array $allowed_units only allow these units (data array indexes)
|
||||||
*
|
*
|
||||||
|
|
|
@ -30,18 +30,10 @@ class phpbb_get_formatted_filesize_test extends phpbb_test_case
|
||||||
|
|
||||||
array(0, '0 BYTES'),
|
array(0, '0 BYTES'),
|
||||||
array(2, '2 BYTES'),
|
array(2, '2 BYTES'),
|
||||||
array(-2, '-2 BYTES'),
|
|
||||||
|
|
||||||
array(1023, '1023 BYTES'),
|
array(1023, '1023 BYTES'),
|
||||||
array(1025, '1 KIB'),
|
array(1025, '1 KIB'),
|
||||||
array(-1023, '-1023 BYTES'),
|
|
||||||
array(-1025, '-1025 BYTES'),
|
|
||||||
|
|
||||||
array(1048575, '1024 KIB'),
|
array(1048575, '1024 KIB'),
|
||||||
|
|
||||||
// large negatives
|
|
||||||
array(-1073741824, '-1073741824 BYTES'),
|
|
||||||
array(-1099511627776, '-1099511627776 BYTES'),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,18 +56,10 @@ class phpbb_get_formatted_filesize_test extends phpbb_test_case
|
||||||
|
|
||||||
array('0', '0 BYTES'),
|
array('0', '0 BYTES'),
|
||||||
array('2', '2 BYTES'),
|
array('2', '2 BYTES'),
|
||||||
array('-2', '-2 BYTES'),
|
|
||||||
|
|
||||||
array('1023', '1023 BYTES'),
|
array('1023', '1023 BYTES'),
|
||||||
array('1025', '1 KIB'),
|
array('1025', '1 KIB'),
|
||||||
array('-1023', '-1023 BYTES'),
|
|
||||||
array('-1025', '-1025 BYTES'),
|
|
||||||
|
|
||||||
array('1048575', '1024 KIB'),
|
array('1048575', '1024 KIB'),
|
||||||
|
|
||||||
// large negatives
|
|
||||||
array('-1073741824', '-1073741824 BYTES'),
|
|
||||||
array('-1099511627776', '-1099511627776 BYTES'),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue