diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index 79ccea37d7a69..647d37e14e966 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -1781,11 +1781,14 @@ static int php_cli_server_send_error_page(php_cli_server *server, php_cli_server php_output_discard(TSRMLS_C); if (!SG(sapi_started)) { static int (*send_header_func)(sapi_headers_struct * TSRMLS_DC); + unsigned char send_default_content_type = SG(sapi_headers).send_default_content_type; send_header_func = sapi_module.send_headers; /* we don't want the header to be sent now */ sapi_module.send_headers = sapi_cli_server_discard_headers; + SG(sapi_headers).send_default_content_type = 0; php_output_deactivate(TSRMLS_C); sapi_module.send_headers = send_header_func; + SG(sapi_headers).send_default_content_type = send_default_content_type; } if (style && Z_STRVAL_P(style)) { char *block = pestrndup(Z_STRVAL_P(style), Z_STRLEN_P(style), 1); diff --git a/sapi/cli/tests/php_cli_server_016.phpt b/sapi/cli/tests/php_cli_server_016.phpt index 3fd065a1c68d7..e64615fd8c77d 100644 --- a/sapi/cli/tests/php_cli_server_016.phpt +++ b/sapi/cli/tests/php_cli_server_016.phpt @@ -1,7 +1,7 @@ --TEST-- Bug #60591 (Memory leak when access a non-exists file) --DESCRIPTION-- -this is a indirect test for bug 50691, since mem leak is reproted in the server side +this is an indirect test for bug 60691, since mem leak is reproted in the server side and require php compiled with --enable-debug --SKIPIF-- +--FILE-- + +--EXPECTF-- +HTTP/1.1 404 Not Found