@@ -1315,7 +1315,7 @@ function run_test($php, $file, $env)
13151315 $ tested = trim ($ section_text ['TEST ' ]);
13161316
13171317 /* For GET/POST/PUT tests, check if cgi sapi is available and if it is, use it. */
1318- if (!empty ($ section_text ['GET ' ]) || !empty ($ section_text ['POST ' ]) || !empty ($ section_text ['POST_RAW ' ]) || !empty ($ section_text ['PUT ' ]) || !empty ($ section_text ['COOKIE ' ]) || !empty ($ section_text ['EXPECTHEADERS ' ])) {
1318+ if (!empty ($ section_text ['GET ' ]) || !empty ($ section_text ['POST ' ]) || !empty ($ section_text ['GZIP_POST ' ]) || ! empty ( $ section_text [ ' DEFLATE_POST ' ]) || ! empty ( $ section_text [ ' POST_RAW ' ]) || !empty ($ section_text ['PUT ' ]) || !empty ($ section_text ['COOKIE ' ]) || !empty ($ section_text ['EXPECTHEADERS ' ])) {
13191319 if (isset ($ php_cgi )) {
13201320 $ old_php = $ php ;
13211321 $ php = $ php_cgi . ' -C ' ;
@@ -1700,15 +1700,6 @@ function run_test($php, $file, $env)
17001700 } else if (array_key_exists ('POST ' , $ section_text ) && !empty ($ section_text ['POST ' ])) {
17011701
17021702 $ post = trim ($ section_text ['POST ' ]);
1703-
1704- if (array_key_exists ('GZIP_POST ' , $ section_text ) && function_exists ('gzencode ' )) {
1705- $ post = gzencode ($ post , 9 , FORCE_GZIP );
1706- $ env ['HTTP_CONTENT_ENCODING ' ] = 'gzip ' ;
1707- } else if (array_key_exists ('DEFLATE_POST ' , $ section_text ) && function_exists ('gzcompress ' )) {
1708- $ post = gzcompress ($ post , 9 );
1709- $ env ['HTTP_CONTENT_ENCODING ' ] = 'deflate ' ;
1710- }
1711-
17121703 save_text ($ tmp_post , $ post );
17131704 $ content_length = strlen ($ post );
17141705
@@ -1718,6 +1709,35 @@ function run_test($php, $file, $env)
17181709
17191710 $ cmd = "$ php $ pass_options $ ini_settings -f \"$ test_file \" 2>&1 < \"$ tmp_post \"" ;
17201711
1712+ } else if (array_key_exists ('GZIP_POST ' , $ section_text ) && !empty ($ section_text ['GZIP_POST ' ])) {
1713+
1714+ $ post = trim ($ section_text ['GZIP_POST ' ]);
1715+ $ post = gzencode ($ post , 9 , FORCE_GZIP );
1716+ $ env ['HTTP_CONTENT_ENCODING ' ] = 'gzip ' ;
1717+
1718+ save_text ($ tmp_post , $ post );
1719+ $ content_length = strlen ($ post );
1720+
1721+ $ env ['REQUEST_METHOD ' ] = 'POST ' ;
1722+ $ env ['CONTENT_TYPE ' ] = 'application/x-www-form-urlencoded ' ;
1723+ $ env ['CONTENT_LENGTH ' ] = $ content_length ;
1724+
1725+ $ cmd = "$ php $ pass_options $ ini_settings -f \"$ test_file \" 2>&1 < \"$ tmp_post \"" ;
1726+
1727+ } else if (array_key_exists ('DEFLATE_POST ' , $ section_text ) && !empty ($ section_text ['DEFLATE_POST ' ])) {
1728+ $ post = trim ($ section_text ['DEFLATE_POST ' ]);
1729+ $ post = gzcompress ($ post , 9 );
1730+ $ env ['HTTP_CONTENT_ENCODING ' ] = 'deflate ' ;
1731+ save_text ($ tmp_post , $ post );
1732+ $ content_length = strlen ($ post );
1733+
1734+ $ env ['REQUEST_METHOD ' ] = 'POST ' ;
1735+ $ env ['CONTENT_TYPE ' ] = 'application/x-www-form-urlencoded ' ;
1736+ $ env ['CONTENT_LENGTH ' ] = $ content_length ;
1737+
1738+ $ cmd = "$ php $ pass_options $ ini_settings -f \"$ test_file \" 2>&1 < \"$ tmp_post \"" ;
1739+
1740+
17211741 } else {
17221742
17231743 $ env ['REQUEST_METHOD ' ] = 'GET ' ;
0 commit comments