aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2012-11-16 08:28:35 +0100
committerAndreas Fischer <bantu@phpbb.com>2012-11-16 14:56:15 +0100
commit7cbd440e7a69eb836eb9d58800f1c535d41b83ab (patch)
treef34d4b565cb2892fa663696a2596693e6fe6a638
parent4e3a42f59fa32fb1a3e14cff959b19576e5ba7cf (diff)
downloadforums-7cbd440e7a69eb836eb9d58800f1c535d41b83ab.tar
forums-7cbd440e7a69eb836eb9d58800f1c535d41b83ab.tar.gz
forums-7cbd440e7a69eb836eb9d58800f1c535d41b83ab.tar.bz2
forums-7cbd440e7a69eb836eb9d58800f1c535d41b83ab.tar.xz
forums-7cbd440e7a69eb836eb9d58800f1c535d41b83ab.zip
[ticket/11192] Mark negative byte numbers as unsupported.
PHPBB3-11192
-rw-r--r--phpBB/includes/functions.php2
-rw-r--r--tests/functions/get_formatted_filesize_test.php16
2 files changed, 1 insertions, 17 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 33545ab845..8688ba3f7e 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -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)
*
diff --git a/tests/functions/get_formatted_filesize_test.php b/tests/functions/get_formatted_filesize_test.php
index 88866f90ac..c4793e8073 100644
--- a/tests/functions/get_formatted_filesize_test.php
+++ b/tests/functions/get_formatted_filesize_test.php
@@ -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'),
);
}