[ticket/11192] Mark negative byte numbers as unsupported.

PHPBB3-11192
This commit is contained in:
Andreas Fischer 2012-11-16 08:28:35 +01:00
parent 4e3a42f59f
commit 7cbd440e7a
2 changed files with 1 additions and 17 deletions

View file

@ -289,7 +289,7 @@ function phpbb_gmgetdate($time = false)
/**
* 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 array $allowed_units only allow these units (data array indexes)
*

View file

@ -30,18 +30,10 @@ class phpbb_get_formatted_filesize_test extends phpbb_test_case
array(0, '0 BYTES'),
array(2, '2 BYTES'),
array(-2, '-2 BYTES'),
array(1023, '1023 BYTES'),
array(1025, '1 KIB'),
array(-1023, '-1023 BYTES'),
array(-1025, '-1025 BYTES'),
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('2', '2 BYTES'),
array('-2', '-2 BYTES'),
array('1023', '1023 BYTES'),
array('1025', '1 KIB'),
array('-1023', '-1023 BYTES'),
array('-1025', '-1025 BYTES'),
array('1048575', '1024 KIB'),
// large negatives
array('-1073741824', '-1073741824 BYTES'),
array('-1099511627776', '-1099511627776 BYTES'),
);
}