From 47ad013fb3cdbac5f0b1276b0197d6def055e95e Mon Sep 17 00:00:00 2001 From: Reikion Date: Thu, 10 Nov 2016 22:20:41 +0100 Subject: Make sure that return_bytes function returns int value php_admin_value[post_max_size] in PHP fpm pool config set to big integer (i.e. 106954752) causes fb-client to crash if file is bigger than 10485760 bytes with traceback Traceback (most recent call last): [...] File "/usr/bin/fb", line 138, in upload_files if self.serverConfig is not None and (currentChunkSize + filesize > self.serverConfig["request_max_size"] \ TypeError: unorderable types: int() > str() because api/v2.1.0/file/get_config returns "request_max_size" as string Changes by Florian Pritz: - Add test - Add github PR body as commit message - Split off indentation change Signed-off-by: Florian Pritz --- application/test/tests/test_filebin_helper.php | 1 + 1 file changed, 1 insertion(+) (limited to 'application/test/tests/test_filebin_helper.php') diff --git a/application/test/tests/test_filebin_helper.php b/application/test/tests/test_filebin_helper.php index edebb13ca..c505dfe8a 100644 --- a/application/test/tests/test_filebin_helper.php +++ b/application/test/tests/test_filebin_helper.php @@ -66,5 +66,6 @@ class test_filebin_helper extends \test\Test { $this->t->is(return_bytes("1M"), 1*1024*1024, "1M"); $this->t->is(return_bytes("1G"), 1*1024*1024*1024, "1G"); $this->t->is(return_bytes("1P"), "1P", "unhandled text: 1P"); + $this->t->ok(return_bytes("106954752") === 106954752, "value without unit is returned as int"); } } -- cgit v1.2.3-24-g4f1b