diff options
| author | Ben Fuhrmannek | 2014-07-11 16:15:21 +0200 |
|---|---|---|
| committer | Ben Fuhrmannek | 2014-07-11 16:15:21 +0200 |
| commit | dd270c094df080ff8438d29e14ec1bbffe0ca993 (patch) | |
| tree | 17dda65b857642f20a7bde6917ef68eda68cecf1 /tests/filter | |
| parent | d5b13494cb7ef97bfe2efb7446badbabb4e7f141 (diff) | |
remove_binary and disallow_binary allow utf-8. +testcases
Diffstat (limited to 'tests/filter')
| -rw-r--r-- | tests/filter/suhosin_upload_disallow_binary_utf8.phpt | 43 | ||||
| -rw-r--r-- | tests/filter/suhosin_upload_remove_binary.phpt | bin | 0 -> 796 bytes | |||
| -rw-r--r-- | tests/filter/suhosin_upload_remove_binary_utf8.phpt | 31 |
3 files changed, 74 insertions, 0 deletions
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 @@ | |||
| 1 | --TEST-- | ||
| 2 | Testing: suhosin.upload.disallow_binary=On with UTF-8 | ||
| 3 | --INI-- | ||
| 4 | suhosin.log.syslog=0 | ||
| 5 | suhosin.log.sapi=0 | ||
| 6 | suhosin.log.stdout=255 | ||
| 7 | suhosin.log.script=0 | ||
| 8 | file_uploads=1 | ||
| 9 | suhosin.upload.disallow_binary=On | ||
| 10 | max_file_uploads=40 | ||
| 11 | suhosin.upload.max_uploads=40 | ||
| 12 | --SKIPIF-- | ||
| 13 | <?php include('skipif.inc'); ?> | ||
| 14 | --COOKIE-- | ||
| 15 | --GET-- | ||
| 16 | --POST_RAW-- | ||
| 17 | Content-Type: multipart/form-data; boundary=bound | ||
| 18 | --bound | ||
| 19 | Content-Disposition: form-data; name="test"; filename="test" | ||
| 20 | |||
| 21 | Spaß am Gerät! | ||
| 22 | |||
| 23 | --bound-- | ||
| 24 | --FILE-- | ||
| 25 | <?php | ||
| 26 | var_dump($_FILES); | ||
| 27 | ?> | ||
| 28 | --EXPECTF-- | ||
| 29 | array(1) { | ||
| 30 | ["test"]=> | ||
| 31 | array(5) { | ||
| 32 | ["name"]=> | ||
| 33 | string(4) "test" | ||
| 34 | ["type"]=> | ||
| 35 | string(0) "" | ||
| 36 | ["tmp_name"]=> | ||
| 37 | string(%d) "%s" | ||
| 38 | ["error"]=> | ||
| 39 | int(0) | ||
| 40 | ["size"]=> | ||
| 41 | int(17) | ||
| 42 | } | ||
| 43 | } | ||
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 --- /dev/null +++ b/tests/filter/suhosin_upload_remove_binary.phpt | |||
| Binary files 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 @@ | |||
| 1 | --TEST-- | ||
| 2 | Testing: suhosin.upload.remove_binary=On with UTF-8 | ||
| 3 | --INI-- | ||
| 4 | suhosin.log.syslog=0 | ||
| 5 | suhosin.log.sapi=0 | ||
| 6 | suhosin.log.stdout=255 | ||
| 7 | suhosin.log.script=0 | ||
| 8 | file_uploads=1 | ||
| 9 | suhosin.upload.disallow_binary=Off | ||
| 10 | suhosin.upload.remove_binary=On | ||
| 11 | max_file_uploads=40 | ||
| 12 | suhosin.upload.max_uploads=40 | ||
| 13 | --SKIPIF-- | ||
| 14 | <?php include('skipif.inc'); ?> | ||
| 15 | --COOKIE-- | ||
| 16 | --GET-- | ||
| 17 | --POST_RAW-- | ||
| 18 | Content-Type: multipart/form-data; boundary=bound | ||
| 19 | --bound | ||
| 20 | Content-Disposition: form-data; name="test"; filename="test" | ||
| 21 | |||
| 22 | Spaß am Gerät! | ||
| 23 | |||
| 24 | --bound-- | ||
| 25 | --FILE-- | ||
| 26 | <?php | ||
| 27 | var_dump(file_get_contents($_FILES['test']['tmp_name'])); | ||
| 28 | ?> | ||
| 29 | --EXPECTF-- | ||
| 30 | string(17) "Spaß am Gerät! | ||
| 31 | " \ No newline at end of file | ||
