1--TEST--
2FPM: GHSA-54hq-v5wp-fqgv - max_multipart_body_parts ini custom value
3--SKIPIF--
4<?php include "skipif.inc"; ?>
5--FILE--
6<?php
7
8require_once "tester.inc";
9
10$cfg = <<<EOT
11[global]
12error_log = {{FILE:LOG}}
13[unconfined]
14listen = {{ADDR}}
15pm = dynamic
16pm.max_children = 5
17pm.start_servers = 1
18pm.min_spare_servers = 1
19pm.max_spare_servers = 3
20php_admin_value[html_errors] = false
21php_admin_value[max_input_vars] = 20
22php_admin_value[max_file_uploads] = 5
23php_admin_value[max_multipart_body_parts] = 10
24php_admin_flag[display_errors] = On
25php_admin_flag[display_startup_errors] = On
26php_admin_flag[log_errors] = On
27EOT;
28
29$code = <<<EOT
30<?php
31var_dump(count(\$_POST));
32EOT;
33
34$tester = new FPM\Tester($cfg, $code);
35$tester->start();
36$tester->expectLogStartNotices();
37echo $tester
38    ->request(stdin: [
39        'parts' => [
40            'count' => 30,
41        ]
42    ])
43    ->getBody();
44$tester->terminate();
45$tester->close();
46
47?>
48--EXPECT--
49Warning: Unknown: Multipart body parts limit exceeded 10. To increase the limit change max_multipart_body_parts in php.ini. in Unknown on line 0
50int(10)
51--CLEAN--
52<?php
53require_once "tester.inc";
54FPM\Tester::clean();
55?>
56