diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/filter/server_user_agent_strip_off.phpt | 27 | ||||
| -rw-r--r-- | tests/filter/server_user_agent_strip_on.phpt | 27 |
2 files changed, 54 insertions, 0 deletions
diff --git a/tests/filter/server_user_agent_strip_off.phpt b/tests/filter/server_user_agent_strip_off.phpt new file mode 100644 index 0000000..36c6580 --- /dev/null +++ b/tests/filter/server_user_agent_strip_off.phpt | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | --TEST-- | ||
| 2 | Testing: suhosin.server.strip=On | ||
| 3 | --DESCRIPTION-- | ||
| 4 | This test is not exactly what we want, but good enough due to limitations of the test framework. | ||
| 5 | --INI-- | ||
| 6 | suhosin.log.syslog=0 | ||
| 7 | suhosin.log.sapi=0 | ||
| 8 | suhosin.log.stdout=255 | ||
| 9 | suhosin.log.script=0 | ||
| 10 | suhosin.server.strip=Off | ||
| 11 | --SKIPIF-- | ||
| 12 | <?php include('skipif.inc'); ?> | ||
| 13 | --ENV-- | ||
| 14 | return <<<END | ||
| 15 | HTTP_USER_AGENT=Mozilla/5.0 (Windows NT 6.0; rv:29.0) <script>alert('123');</script>Gecko/20100101 Firefox/29.0 | ||
| 16 | END; | ||
| 17 | --COOKIE-- | ||
| 18 | --GET-- | ||
| 19 | A=B | ||
| 20 | --POST-- | ||
| 21 | --FILE-- | ||
| 22 | <?php | ||
| 23 | var_dump($_SERVER['HTTP_USER_AGENT']); | ||
| 24 | ?> | ||
| 25 | --EXPECTF-- | ||
| 26 | string(95) "Mozilla/5.0 (Windows NT 6.0; rv:29.0) <script>alert('123');</script>Gecko/20100101 Firefox/29.0" | ||
| 27 | |||
diff --git a/tests/filter/server_user_agent_strip_on.phpt b/tests/filter/server_user_agent_strip_on.phpt new file mode 100644 index 0000000..73d577c --- /dev/null +++ b/tests/filter/server_user_agent_strip_on.phpt | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | --TEST-- | ||
| 2 | Testing: suhosin.server.strip=On | ||
| 3 | --DESCRIPTION-- | ||
| 4 | This test is not exactly what we want, but good enough due to limitations of the test framework. | ||
| 5 | --INI-- | ||
| 6 | suhosin.log.syslog=0 | ||
| 7 | suhosin.log.sapi=0 | ||
| 8 | suhosin.log.stdout=255 | ||
| 9 | suhosin.log.script=0 | ||
| 10 | suhosin.server.strip=On | ||
| 11 | --SKIPIF-- | ||
| 12 | <?php include('skipif.inc'); ?> | ||
| 13 | --ENV-- | ||
| 14 | return <<<END | ||
| 15 | HTTP_USER_AGENT=Mozilla/5.0 (Windows NT 6.0; rv:29.0) <script>alert('123');</script>Gecko/20100101 Firefox/29.0 | ||
| 16 | END; | ||
| 17 | --COOKIE-- | ||
| 18 | --GET-- | ||
| 19 | A=B | ||
| 20 | --POST-- | ||
| 21 | --FILE-- | ||
| 22 | <?php | ||
| 23 | var_dump($_SERVER['HTTP_USER_AGENT']); | ||
| 24 | ?> | ||
| 25 | --EXPECTF-- | ||
| 26 | string(95) "Mozilla/5.0 (Windows NT 6.0; rv:29.0) ?script?alert(?123?);?/script?Gecko/20100101 Firefox/29.0" | ||
| 27 | |||
