summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBen Fuhrmannek2014-07-11 16:15:21 +0200
committerBen Fuhrmannek2014-07-11 16:15:21 +0200
commitdd270c094df080ff8438d29e14ec1bbffe0ca993 (patch)
tree17dda65b857642f20a7bde6917ef68eda68cecf1 /tests
parentd5b13494cb7ef97bfe2efb7446badbabb4e7f141 (diff)
remove_binary and disallow_binary allow utf-8. +testcases
Diffstat (limited to 'tests')
-rw-r--r--tests/filter/suhosin_upload_disallow_binary_utf8.phpt43
-rw-r--r--tests/filter/suhosin_upload_remove_binary.phptbin0 -> 796 bytes
-rw-r--r--tests/filter/suhosin_upload_remove_binary_utf8.phpt31
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--
2Testing: suhosin.upload.disallow_binary=On with UTF-8
3--INI--
4suhosin.log.syslog=0
5suhosin.log.sapi=0
6suhosin.log.stdout=255
7suhosin.log.script=0
8file_uploads=1
9suhosin.upload.disallow_binary=On
10max_file_uploads=40
11suhosin.upload.max_uploads=40
12--SKIPIF--
13<?php include('skipif.inc'); ?>
14--COOKIE--
15--GET--
16--POST_RAW--
17Content-Type: multipart/form-data; boundary=bound
18--bound
19Content-Disposition: form-data; name="test"; filename="test"
20
21Spaß am Gerät!
22
23--bound--
24--FILE--
25<?php
26var_dump($_FILES);
27?>
28--EXPECTF--
29array(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--
2Testing: suhosin.upload.remove_binary=On with UTF-8
3--INI--
4suhosin.log.syslog=0
5suhosin.log.sapi=0
6suhosin.log.stdout=255
7suhosin.log.script=0
8file_uploads=1
9suhosin.upload.disallow_binary=Off
10suhosin.upload.remove_binary=On
11max_file_uploads=40
12suhosin.upload.max_uploads=40
13--SKIPIF--
14<?php include('skipif.inc'); ?>
15--COOKIE--
16--GET--
17--POST_RAW--
18Content-Type: multipart/form-data; boundary=bound
19--bound
20Content-Disposition: form-data; name="test"; filename="test"
21
22Spaß am Gerät!
23
24--bound--
25--FILE--
26<?php
27var_dump(file_get_contents($_FILES['test']['tmp_name']));
28?>
29--EXPECTF--
30string(17) "Spaß am Gerät!
31" \ No newline at end of file