diff options
author | Michael Wallner <mike@php.net> | 2012-01-31 10:47:21 +0000 |
---|---|---|
committer | Michael Wallner <mike@php.net> | 2012-01-31 10:47:21 +0000 |
commit | 93c549913fd113a82680d3ad86d3ec8e18dc1187 (patch) | |
tree | dd99890d6354c3df2f611a963a9614bbf1b48b7b /sapi/cli/php_cli_server.c | |
parent | c64a69c8b885ac138fa5971c8f784919fd003ca5 (diff) | |
download | php-git-93c549913fd113a82680d3ad86d3ec8e18dc1187.tar.gz |
fix usage of php_output_(de)activate; I guess this code doesn't bother about one more hack;
Diffstat (limited to 'sapi/cli/php_cli_server.c')
-rw-r--r-- | sapi/cli/php_cli_server.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index ffb971618f..e8b6261978 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -1755,11 +1755,22 @@ static int php_cli_server_send_error_page(php_cli_server *server, php_cli_server int err = 0; zval *style = NULL; zend_try { + if (!SG(sapi_started)) { + php_output_activate(TSRMLS_C); + } php_output_start_user(NULL, 0, PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC); php_info_print_style(TSRMLS_C); MAKE_STD_ZVAL(style); php_output_get_contents(style TSRMLS_CC); php_output_discard(TSRMLS_C); + if (!SG(sapi_started)) { + static int (*send_header_func)(sapi_headers_struct * TSRMLS_DC); + 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; + php_output_deactivate(TSRMLS_C); + sapi_module.send_headers = send_header_func; + } if (style && Z_STRVAL_P(style)) { char *block = pestrndup(Z_STRVAL_P(style), Z_STRLEN_P(style), 1); php_cli_server_chunk *chunk = php_cli_server_chunk_heap_new(block, block, Z_STRLEN_P(style)); |