summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/filter/server_encode_off.phpt31
-rw-r--r--tests/filter/server_encode_on.phpt30
-rw-r--r--tests/filter/server_strip_off.phpt27
-rw-r--r--tests/filter/server_strip_on.phpt27
4 files changed, 115 insertions, 0 deletions
diff --git a/tests/filter/server_encode_off.phpt b/tests/filter/server_encode_off.phpt
new file mode 100644
index 0000000..8daccea
--- /dev/null
+++ b/tests/filter/server_encode_off.phpt
@@ -0,0 +1,31 @@
1--TEST--
2Testing: suhosin.server.encode=Off
3--DESCRIPTION--
4This test is incomplete but at the moment we cannot do better with the standard test framework.
5--INI--
6suhosin.log.syslog=0
7suhosin.log.sapi=0
8suhosin.log.stdout=255
9suhosin.log.script=0
10suhosin.server.encode=Off
11--SKIPIF--
12<?php include('skipif.inc'); ?>
13--ENV--
14return <<<END
15REQUEST_URI=AAA<>"'`!AAA
16END;
17--COOKIE--
18--GET--
19BBB<>"'`!BBB
20--POST--
21--FILE--
22<?php
23// THIS TEST IS INCOMPLETE!!! SEE DESCRIPTION
24var_dump($_SERVER['REQUEST_URI']);
25var_dump($_SERVER['QUERY_STRING']);
26?>
27--EXPECTF--
28string(12) "AAA<>"'`!AAA"
29string(12) "BBB<>"'`!BBB"
30
31
diff --git a/tests/filter/server_encode_on.phpt b/tests/filter/server_encode_on.phpt
new file mode 100644
index 0000000..4cd7a66
--- /dev/null
+++ b/tests/filter/server_encode_on.phpt
@@ -0,0 +1,30 @@
1--TEST--
2Testing: suhosin.server.encode=On
3--DESCRIPTION--
4This test is incomplete but at the moment we cannot do better with the standard test framework.
5--INI--
6suhosin.log.syslog=0
7suhosin.log.sapi=0
8suhosin.log.stdout=255
9suhosin.log.script=0
10suhosin.server.encode=On
11--SKIPIF--
12<?php include('skipif.inc'); ?>
13--ENV--
14return <<<END
15REQUEST_URI=AAA<>"'`!AAA
16END;
17--COOKIE--
18--GET--
19BBB<>"'`!BBB
20--POST--
21--FILE--
22<?php
23// THIS TEST IS INCOMPLETE!!! SEE DESCRIPTION
24var_dump($_SERVER['REQUEST_URI']);
25var_dump($_SERVER['QUERY_STRING']);
26?>
27--EXPECTF--
28string(22) "AAA%3C%3E%22%27%60!AAA"
29string(22) "BBB%3C%3E%22%27%60!BBB"
30
diff --git a/tests/filter/server_strip_off.phpt b/tests/filter/server_strip_off.phpt
new file mode 100644
index 0000000..75c326e
--- /dev/null
+++ b/tests/filter/server_strip_off.phpt
@@ -0,0 +1,27 @@
1--TEST--
2Testing: suhosin.server.strip=Off
3--DESCRIPTION--
4This test is incomplete but at the moment we cannot do better with the standard test framework.
5--INI--
6suhosin.log.syslog=0
7suhosin.log.sapi=0
8suhosin.log.stdout=255
9suhosin.log.script=0
10suhosin.server.strip=Off
11--SKIPIF--
12<?php include('skipif.inc'); ?>
13--ENV--
14return <<<END
15SCRIPT_NAME=X/index.php/THIS_IS_A_FAKE_NAME<>"'`!AAA
16END;
17--COOKIE--
18--GET--
19A=B
20--POST--
21--FILE--
22<?php
23// THIS TEST IS INCOMPLETE!!! SEE DESCRIPTION
24var_dump($_SERVER['PHP_SELF']);
25?>
26--EXPECTF--
27string(40) "X/index.php/THIS_IS_A_FAKE_NAME<>"'`!AAA"
diff --git a/tests/filter/server_strip_on.phpt b/tests/filter/server_strip_on.phpt
new file mode 100644
index 0000000..c595e95
--- /dev/null
+++ b/tests/filter/server_strip_on.phpt
@@ -0,0 +1,27 @@
1--TEST--
2Testing: suhosin.server.strip=On
3--DESCRIPTION--
4This test is incomplete but at the moment we cannot do better with the standard test framework.
5--INI--
6suhosin.log.syslog=0
7suhosin.log.sapi=0
8suhosin.log.stdout=255
9suhosin.log.script=0
10suhosin.server.strip=On
11--SKIPIF--
12<?php include('skipif.inc'); ?>
13--ENV--
14return <<<END
15SCRIPT_NAME=X/index.php/THIS_IS_A_FAKE_NAME<>"'`!AAA
16END;
17--COOKIE--
18--GET--
19A=B
20--POST--
21--FILE--
22<?php
23// THIS TEST IS INCOMPLETE!!! SEE DESCRIPTION
24var_dump($_SERVER['PHP_SELF']);
25?>
26--EXPECTF--
27string(40) "X/index.php/THIS_IS_A_FAKE_NAME?????!AAA"