summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBen Fuhrmannek2014-07-14 13:08:16 +0200
committerBen Fuhrmannek2014-07-14 13:08:16 +0200
commit81435af6f665c73e46562cf1489aaa3f0435b615 (patch)
tree55bff05b6b568d1e25bbb9559bcec6fb3c8b31d6 /tests
parent1dc59e48642c98e34320f1a31c120fbf290fd509 (diff)
parent6bb8cdbbd56c09a6864b40ce21f9a87abd942305 (diff)
Merge branch 'filter'
Diffstat (limited to 'tests')
-rw-r--r--tests/filter/suhosin_upload_disallow_binary_utf8.phpt44
-rw-r--r--tests/filter/suhosin_upload_disallow_binary_utf8fail.phpt45
-rw-r--r--tests/filter/suhosin_upload_remove_binary.phptbin0 -> 796 bytes
-rw-r--r--tests/filter/suhosin_upload_remove_binary_utf8.phpt32
-rw-r--r--tests/filter/suhosin_upload_remove_binary_utf8fail.phpt32
5 files changed, 153 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..557a8d5
--- /dev/null
+++ b/tests/filter/suhosin_upload_disallow_binary_utf8.phpt
@@ -0,0 +1,44 @@
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
10suhosin.upload.allow_utf8=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($_FILES);
28?>
29--EXPECTF--
30array(1) {
31 ["test"]=>
32 array(5) {
33 ["name"]=>
34 string(4) "test"
35 ["type"]=>
36 string(0) ""
37 ["tmp_name"]=>
38 string(%d) "%s"
39 ["error"]=>
40 int(0)
41 ["size"]=>
42 int(17)
43 }
44}
diff --git a/tests/filter/suhosin_upload_disallow_binary_utf8fail.phpt b/tests/filter/suhosin_upload_disallow_binary_utf8fail.phpt
new file mode 100644
index 0000000..413d25a
--- /dev/null
+++ b/tests/filter/suhosin_upload_disallow_binary_utf8fail.phpt
@@ -0,0 +1,45 @@
1--TEST--
2Testing: suhosin.upload.disallow_binary=On with UTF-8 and allow_utf8=Off
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
10suhosin.upload.allow_utf8=Off
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($_FILES);
28?>
29--EXPECTF--
30array(1) {
31 ["test"]=>
32 array(5) {
33 ["name"]=>
34 string(4) "test"
35 ["type"]=>
36 string(0) ""
37 ["tmp_name"]=>
38 string(0) ""
39 ["error"]=>
40 int(8)
41 ["size"]=>
42 int(0)
43 }
44}
45ALERT - uploaded file contains binary data - file dropped (attacker 'REMOTE_ADDR not set', file '%s')
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..6fbd240
--- /dev/null
+++ b/tests/filter/suhosin_upload_remove_binary_utf8.phpt
@@ -0,0 +1,32 @@
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
11suhosin.upload.allow_utf8=On
12max_file_uploads=40
13suhosin.upload.max_uploads=40
14--SKIPIF--
15<?php include('skipif.inc'); ?>
16--COOKIE--
17--GET--
18--POST_RAW--
19Content-Type: multipart/form-data; boundary=bound
20--bound
21Content-Disposition: form-data; name="test"; filename="test"
22
23Spaß am Gerät!
24
25--bound--
26--FILE--
27<?php
28var_dump(file_get_contents($_FILES['test']['tmp_name']));
29?>
30--EXPECTF--
31string(17) "Spaß am Gerät!
32" \ No newline at end of file
diff --git a/tests/filter/suhosin_upload_remove_binary_utf8fail.phpt b/tests/filter/suhosin_upload_remove_binary_utf8fail.phpt
new file mode 100644
index 0000000..5c31115
--- /dev/null
+++ b/tests/filter/suhosin_upload_remove_binary_utf8fail.phpt
@@ -0,0 +1,32 @@
1--TEST--
2Testing: suhosin.upload.remove_binary=On with UTF-8 and allow_utf8=Off
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
11suhosin.upload.allow_utf8=Off
12max_file_uploads=40
13suhosin.upload.max_uploads=40
14--SKIPIF--
15<?php include('skipif.inc'); ?>
16--COOKIE--
17--GET--
18--POST_RAW--
19Content-Type: multipart/form-data; boundary=bound
20--bound
21Content-Disposition: form-data; name="test"; filename="test"
22
23Spaß am Gerät!
24
25--bound--
26--FILE--
27<?php
28var_dump(file_get_contents($_FILES['test']['tmp_name']));
29?>
30--EXPECTF--
31string(13) "Spa am Gert!
32" \ No newline at end of file