From dd270c094df080ff8438d29e14ec1bbffe0ca993 Mon Sep 17 00:00:00 2001 From: Ben Fuhrmannek Date: Fri, 11 Jul 2014 16:15:21 +0200 Subject: remove_binary and disallow_binary allow utf-8. +testcases --- .../suhosin_upload_disallow_binary_utf8.phpt | 43 +++++++++++++++++++++ tests/filter/suhosin_upload_remove_binary.phpt | Bin 0 -> 796 bytes .../filter/suhosin_upload_remove_binary_utf8.phpt | 31 +++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 tests/filter/suhosin_upload_disallow_binary_utf8.phpt create mode 100644 tests/filter/suhosin_upload_remove_binary.phpt create mode 100644 tests/filter/suhosin_upload_remove_binary_utf8.phpt (limited to 'tests') diff --git a/tests/filter/suhosin_upload_disallow_binary_utf8.phpt b/tests/filter/suhosin_upload_disallow_binary_utf8.phpt new file mode 100644 index 0000000..4661dc9 --- /dev/null +++ b/tests/filter/suhosin_upload_disallow_binary_utf8.phpt @@ -0,0 +1,43 @@ +--TEST-- +Testing: suhosin.upload.disallow_binary=On with UTF-8 +--INI-- +suhosin.log.syslog=0 +suhosin.log.sapi=0 +suhosin.log.stdout=255 +suhosin.log.script=0 +file_uploads=1 +suhosin.upload.disallow_binary=On +max_file_uploads=40 +suhosin.upload.max_uploads=40 +--SKIPIF-- + +--COOKIE-- +--GET-- +--POST_RAW-- +Content-Type: multipart/form-data; boundary=bound +--bound +Content-Disposition: form-data; name="test"; filename="test" + +Spaß am Gerät! + +--bound-- +--FILE-- + +--EXPECTF-- +array(1) { + ["test"]=> + array(5) { + ["name"]=> + string(4) "test" + ["type"]=> + string(0) "" + ["tmp_name"]=> + string(%d) "%s" + ["error"]=> + int(0) + ["size"]=> + int(17) + } +} diff --git a/tests/filter/suhosin_upload_remove_binary.phpt b/tests/filter/suhosin_upload_remove_binary.phpt new file mode 100644 index 0000000..f4337d9 Binary files /dev/null and b/tests/filter/suhosin_upload_remove_binary.phpt differ diff --git a/tests/filter/suhosin_upload_remove_binary_utf8.phpt b/tests/filter/suhosin_upload_remove_binary_utf8.phpt new file mode 100644 index 0000000..2d10eaa --- /dev/null +++ b/tests/filter/suhosin_upload_remove_binary_utf8.phpt @@ -0,0 +1,31 @@ +--TEST-- +Testing: suhosin.upload.remove_binary=On with UTF-8 +--INI-- +suhosin.log.syslog=0 +suhosin.log.sapi=0 +suhosin.log.stdout=255 +suhosin.log.script=0 +file_uploads=1 +suhosin.upload.disallow_binary=Off +suhosin.upload.remove_binary=On +max_file_uploads=40 +suhosin.upload.max_uploads=40 +--SKIPIF-- + +--COOKIE-- +--GET-- +--POST_RAW-- +Content-Type: multipart/form-data; boundary=bound +--bound +Content-Disposition: form-data; name="test"; filename="test" + +Spaß am Gerät! + +--bound-- +--FILE-- + +--EXPECTF-- +string(17) "Spaß am Gerät! +" \ No newline at end of file -- cgit v1.3