diff options
| author | jvoisin | 2019-02-23 12:06:51 +0100 |
|---|---|---|
| committer | jvoisin | 2019-02-23 12:12:45 +0100 |
| commit | d03c3c8d01f6f507bf844fec07477f30e3db61d9 (patch) | |
| tree | 040773d005257a0541da580c26bbb2b0831155b2 /src/tests/eval_blacklist | |
| parent | a48297dfc1144931e18073a87ed83ea337e3d37a (diff) | |
Fix the testsuite on php8.
In php8, it's non-trivial to hook strlen,
since this function is usually optimized away
by the compiler.
Diffstat (limited to 'src/tests/eval_blacklist')
10 files changed, 28 insertions, 28 deletions
diff --git a/src/tests/eval_blacklist/config/eval_backlist.ini b/src/tests/eval_blacklist/config/eval_backlist.ini index b181598..53c2801 100644 --- a/src/tests/eval_blacklist/config/eval_backlist.ini +++ b/src/tests/eval_blacklist/config/eval_backlist.ini | |||
| @@ -1 +1 @@ | |||
| sp.eval_blacklist.list("strlen"); | sp.eval_blacklist.list("strtoupper"); | ||
diff --git a/src/tests/eval_blacklist/config/eval_backlist_list.ini b/src/tests/eval_blacklist/config/eval_backlist_list.ini index b395d03..ffa281e 100644 --- a/src/tests/eval_blacklist/config/eval_backlist_list.ini +++ b/src/tests/eval_blacklist/config/eval_backlist_list.ini | |||
| @@ -1 +1 @@ | |||
| sp.eval_blacklist.list("strcmp,strlen"); | sp.eval_blacklist.list("strcmp,strtoupper,strlen"); | ||
diff --git a/src/tests/eval_blacklist/config/eval_backlist_simulation.ini b/src/tests/eval_blacklist/config/eval_backlist_simulation.ini index 2d8dc73..bb8b5dd 100644 --- a/src/tests/eval_blacklist/config/eval_backlist_simulation.ini +++ b/src/tests/eval_blacklist/config/eval_backlist_simulation.ini | |||
| @@ -1 +1 @@ | |||
| sp.eval_blacklist.list("strlen").simulation(); | sp.eval_blacklist.list("strtoupper").simulation(); | ||
diff --git a/src/tests/eval_blacklist/eval_backlist.phpt b/src/tests/eval_blacklist/eval_backlist.phpt index f24af96..1dbe887 100644 --- a/src/tests/eval_blacklist/eval_backlist.phpt +++ b/src/tests/eval_blacklist/eval_backlist.phpt | |||
| @@ -6,12 +6,12 @@ Eval blacklist | |||
| 6 | sp.configuration_file={PWD}/config/eval_backlist.ini | 6 | sp.configuration_file={PWD}/config/eval_backlist.ini |
| 7 | --FILE-- | 7 | --FILE-- |
| 8 | <?php | 8 | <?php |
| 9 | $a = strlen("1337 1337 1337"); | 9 | $a = strtoupper("1337 1337 1337"); |
| 10 | echo "Outside of eval: $a\n"; | 10 | echo "Outside of eval: $a\n"; |
| 11 | eval('$a = strlen("1234");'); | 11 | eval('$a = strtoupper("1234");'); |
| 12 | echo "After eval: $a\n"; | 12 | echo "After eval: $a\n"; |
| 13 | ?> | 13 | ?> |
| 14 | --EXPECTF-- | 14 | --EXPECTF-- |
| 15 | Outside of eval: 14 | 15 | Outside of eval: 1337 1337 1337 |
| 16 | 16 | ||
| 17 | Fatal error: [snuffleupagus][eval] A call to strlen was tried in eval, in %a/eval_backlist.php:1, dropping it. in %a/eval_backlist.php(4) : eval()'d code on line 1 \ No newline at end of file | 17 | Fatal error: [snuffleupagus][eval] A call to strtoupper was tried in eval, in %a/eval_backlist.php:1, dropping it. in %a/eval_backlist.php(4) : eval()'d code on line 1 |
diff --git a/src/tests/eval_blacklist/eval_backlist_call_user_func.phpt b/src/tests/eval_blacklist/eval_backlist_call_user_func.phpt index 47e8d71..ac48515 100644 --- a/src/tests/eval_blacklist/eval_backlist_call_user_func.phpt +++ b/src/tests/eval_blacklist/eval_backlist_call_user_func.phpt | |||
| @@ -7,8 +7,8 @@ sp.configuration_file={PWD}/config/eval_backlist.ini | |||
| 7 | --FILE-- | 7 | --FILE-- |
| 8 | <?php | 8 | <?php |
| 9 | eval(' | 9 | eval(' |
| 10 | call_user_func("strlen", 2); | 10 | call_user_func("strtoupper", 2); |
| 11 | ') | 11 | ') |
| 12 | ?> | 12 | ?> |
| 13 | --EXPECTF-- | 13 | --EXPECTF-- |
| 14 | Fatal error: [snuffleupagus][eval] A call to strlen was tried in eval, in %s/eval_backlist_call_user_func.php:%d, dropping it. in %s/eval_backlist_call_user_func.php(%d) : eval()'d code on line %d | 14 | Fatal error: [snuffleupagus][eval] A call to strtoupper was tried in eval, in %s/eval_backlist_call_user_func.php:%d, dropping it. in %s/eval_backlist_call_user_func.php(%d) : eval()'d code on line %d |
diff --git a/src/tests/eval_blacklist/eval_backlist_chained.phpt b/src/tests/eval_blacklist/eval_backlist_chained.phpt index 2360e06..dc23857 100644 --- a/src/tests/eval_blacklist/eval_backlist_chained.phpt +++ b/src/tests/eval_blacklist/eval_backlist_chained.phpt | |||
| @@ -8,9 +8,9 @@ sp.configuration_file={PWD}/config/eval_backlist.ini | |||
| 8 | <?php | 8 | <?php |
| 9 | eval(' | 9 | eval(' |
| 10 | cos(1); | 10 | cos(1); |
| 11 | strlen(2); | 11 | strtoupper(2); |
| 12 | sin(3); | 12 | sin(3); |
| 13 | ') | 13 | ') |
| 14 | ?> | 14 | ?> |
| 15 | --EXPECTF-- | 15 | --EXPECTF-- |
| 16 | Fatal error: [snuffleupagus][eval] A call to strlen was tried in eval, in %s/eval_backlist_chained.php:%d, dropping it. in %s/eval_backlist_chained.php(%d) : eval()'d code on line %d | 16 | Fatal error: [snuffleupagus][eval] A call to strtoupper was tried in eval, in %s/eval_backlist_chained.php:%d, dropping it. in %s/eval_backlist_chained.php(%d) : eval()'d code on line %d |
diff --git a/src/tests/eval_blacklist/eval_backlist_list.phpt b/src/tests/eval_blacklist/eval_backlist_list.phpt index 5bf0ea8..d5bbd00 100644 --- a/src/tests/eval_blacklist/eval_backlist_list.phpt +++ b/src/tests/eval_blacklist/eval_backlist_list.phpt | |||
| @@ -6,12 +6,12 @@ Eval blacklist - with a list of functions | |||
| 6 | sp.configuration_file={PWD}/config/eval_backlist_list.ini | 6 | sp.configuration_file={PWD}/config/eval_backlist_list.ini |
| 7 | --FILE-- | 7 | --FILE-- |
| 8 | <?php | 8 | <?php |
| 9 | $a = strlen("1337 1337 1337"); | 9 | $a = strtoupper("1337 1337 1337"); |
| 10 | echo "Outside of eval: $a\n"; | 10 | echo "Outside of eval: $a\n"; |
| 11 | eval('$a = strlen("1234");'); | 11 | eval('$a = strtoupper("1234");'); |
| 12 | echo "After eval: $a\n"; | 12 | echo "After eval: $a\n"; |
| 13 | ?> | 13 | ?> |
| 14 | --EXPECTF-- | 14 | --EXPECTF-- |
| 15 | Outside of eval: 14 | 15 | Outside of eval: 1337 1337 1337 |
| 16 | 16 | ||
| 17 | Fatal error: [snuffleupagus][eval] A call to strlen was tried in eval, in %a/eval_backlist_list.php:1, dropping it. in %a/eval_backlist_list.php(4) : eval()'d code on line 1 \ No newline at end of file | 17 | Fatal error: [snuffleupagus][eval] A call to strtoupper was tried in eval, in %a/eval_backlist_list.php:1, dropping it. in %a/eval_backlist_list.php(4) : eval()'d code on line 1 |
diff --git a/src/tests/eval_blacklist/eval_backlist_simulation.phpt b/src/tests/eval_blacklist/eval_backlist_simulation.phpt index 3089c2d..be4cd3a 100644 --- a/src/tests/eval_blacklist/eval_backlist_simulation.phpt +++ b/src/tests/eval_blacklist/eval_backlist_simulation.phpt | |||
| @@ -6,13 +6,13 @@ Eval blacklist simulation | |||
| 6 | sp.configuration_file={PWD}/config/eval_backlist_simulation.ini | 6 | sp.configuration_file={PWD}/config/eval_backlist_simulation.ini |
| 7 | --FILE-- | 7 | --FILE-- |
| 8 | <?php | 8 | <?php |
| 9 | $a = strlen("1337 1337 1337"); | 9 | $a = strtoupper("1337 1337 1337"); |
| 10 | echo "Outside of eval: $a\n"; | 10 | echo "Outside of eval: $a\n"; |
| 11 | eval('$a = strlen("1234");'); | 11 | eval('$a = strtoupper("1234");'); |
| 12 | echo "After eval: $a\n"; | 12 | echo "After eval: $a\n"; |
| 13 | ?> | 13 | ?> |
| 14 | --EXPECTF-- | 14 | --EXPECTF-- |
| 15 | Outside of eval: 14 | 15 | Outside of eval: 1337 1337 1337 |
| 16 | 16 | ||
| 17 | Warning: [snuffleupagus][eval] A call to strlen was tried in eval, in %a/eval_backlist_simulation.php:1, logging it. in %a/eval_backlist_simulation.php(4) : eval()'d code on line 1 | 17 | Warning: [snuffleupagus][eval] A call to strtoupper was tried in eval, in %a/eval_backlist_simulation.php:1, logging it. in %a/eval_backlist_simulation.php(4) : eval()'d code on line 1 |
| 18 | After eval: 4 \ No newline at end of file | 18 | After eval: 1234 |
diff --git a/src/tests/eval_blacklist/nested_eval_blacklist.phpt b/src/tests/eval_blacklist/nested_eval_blacklist.phpt index 9671a65..244007e 100644 --- a/src/tests/eval_blacklist/nested_eval_blacklist.phpt +++ b/src/tests/eval_blacklist/nested_eval_blacklist.phpt | |||
| @@ -6,7 +6,7 @@ Eval blacklist - nested eval | |||
| 6 | sp.configuration_file={PWD}/config/eval_backlist.ini | 6 | sp.configuration_file={PWD}/config/eval_backlist.ini |
| 7 | --FILE-- | 7 | --FILE-- |
| 8 | <?php | 8 | <?php |
| 9 | $a = strlen("1337 1337 1337"); | 9 | $a = strtoupper("1337 1337 1337"); |
| 10 | echo "Outside of eval: $a\n"; | 10 | echo "Outside of eval: $a\n"; |
| 11 | eval( | 11 | eval( |
| 12 | "echo 'Inception lvl 1...\n'; | 12 | "echo 'Inception lvl 1...\n'; |
| @@ -14,16 +14,16 @@ eval( | |||
| 14 | 'echo \"Inception lvl 2...\n\"; | 14 | 'echo \"Inception lvl 2...\n\"; |
| 15 | eval( | 15 | eval( |
| 16 | \"echo \'Inception lvl 3...\n\'; | 16 | \"echo \'Inception lvl 3...\n\'; |
| 17 | strlen(\'Limbo!\'); | 17 | strtoupper(\'Limbo!\'); |
| 18 | \"); | 18 | \"); |
| 19 | '); | 19 | '); |
| 20 | "); | 20 | "); |
| 21 | echo "After eval: $a\n"; | 21 | echo "After eval: $a\n"; |
| 22 | ?> | 22 | ?> |
| 23 | --EXPECTF-- | 23 | --EXPECTF-- |
| 24 | Outside of eval: 14 | 24 | Outside of eval: 1337 1337 1337 |
| 25 | Inception lvl 1... | 25 | Inception lvl 1... |
| 26 | Inception lvl 2... | 26 | Inception lvl 2... |
| 27 | Inception lvl 3... | 27 | Inception lvl 3... |
| 28 | 28 | ||
| 29 | Fatal error: [snuffleupagus][eval] A call to strlen was tried in eval, in %a/nested_eval_blacklist.php(5) : eval()'d code(4) : eval()'d code:3, dropping it. in %a/nested_eval_blacklist.php(5) : eval()'d code(4) : eval()'d code(4) : eval()'d code on line 3 \ No newline at end of file | 29 | Fatal error: [snuffleupagus][eval] A call to strtoupper was tried in eval, in %a/nested_eval_blacklist.php(5) : eval()'d code(4) : eval()'d code:3, dropping it. in %a/nested_eval_blacklist.php(5) : eval()'d code(4) : eval()'d code(4) : eval()'d code on line 3 |
diff --git a/src/tests/eval_blacklist/nested_eval_blacklist2.phpt b/src/tests/eval_blacklist/nested_eval_blacklist2.phpt index aee41db..9f7a4d0 100644 --- a/src/tests/eval_blacklist/nested_eval_blacklist2.phpt +++ b/src/tests/eval_blacklist/nested_eval_blacklist2.phpt | |||
| @@ -6,7 +6,7 @@ Eval blacklist - nested eval, with a twist | |||
| 6 | sp.configuration_file={PWD}/config/eval_backlist.ini | 6 | sp.configuration_file={PWD}/config/eval_backlist.ini |
| 7 | --FILE-- | 7 | --FILE-- |
| 8 | <?php | 8 | <?php |
| 9 | $a = strlen("1337 1337 1337"); | 9 | $a = strtoupper("1337 1337 1337"); |
| 10 | echo "Outside of eval: $a\n"; | 10 | echo "Outside of eval: $a\n"; |
| 11 | eval( | 11 | eval( |
| 12 | "echo 'Inception lvl 1...\n'; | 12 | "echo 'Inception lvl 1...\n'; |
| @@ -15,15 +15,15 @@ eval( | |||
| 15 | eval( | 15 | eval( |
| 16 | \"echo \'Inception lvl 3...\n\'; | 16 | \"echo \'Inception lvl 3...\n\'; |
| 17 | \"); | 17 | \"); |
| 18 | strlen(\'Limbo!\'); | 18 | strtoupper(\'Limbo!\'); |
| 19 | '); | 19 | '); |
| 20 | "); | 20 | "); |
| 21 | echo "After eval: $a\n"; | 21 | echo "After eval: $a\n"; |
| 22 | ?> | 22 | ?> |
| 23 | --EXPECTF-- | 23 | --EXPECTF-- |
| 24 | Outside of eval: 14 | 24 | Outside of eval: 1337 1337 1337 |
| 25 | Inception lvl 1... | 25 | Inception lvl 1... |
| 26 | Inception lvl 2... | 26 | Inception lvl 2... |
| 27 | Inception lvl 3... | 27 | Inception lvl 3... |
| 28 | 28 | ||
| 29 | Fatal error: [snuffleupagus][eval] A call to strlen was tried in eval, in %a/nested_eval_blacklist2.php(5) : eval()'d code:7, dropping it. in %a/nested_eval_blacklist2.php(5) : eval()'d code(4) : eval()'d code on line 7 \ No newline at end of file | 29 | Fatal error: [snuffleupagus][eval] A call to strtoupper was tried in eval, in %a/nested_eval_blacklist2.php(5) : eval()'d code:7, dropping it. in %a/nested_eval_blacklist2.php(5) : eval()'d code(4) : eval()'d code on line 7 |
