mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Guard display_startup_errors with checking for default (working) output
functions.
This commit is contained in:
parent
04a242541b
commit
97b5bb474e
3 changed files with 12 additions and 6 deletions
|
@ -752,7 +752,12 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
|
|||
efree(log_buffer);
|
||||
}
|
||||
if (PG(display_errors)
|
||||
&& ((!PG(during_request_startup) && PG(display_startup_errors)) || module_initialized)) {
|
||||
&& ((module_initialized && !PG(during_request_startup))
|
||||
|| (PG(display_startup_errors)
|
||||
&& (OG(php_body_write)==php_default_output_func || OG(php_body_write)==php_ub_body_write_no_header || OG(php_body_write)==php_ub_body_write)
|
||||
)
|
||||
)
|
||||
) {
|
||||
|
||||
if (PG(xmlrpc_errors)) {
|
||||
php_printf("<?xml version=\"1.0\"?><methodResponse><fault><value><struct><member><name>faultCode</name><value><int>%ld</int></value></member><member><name>faultString</name><value><string>%s:%s in %s on line %d</string></value></member></struct></value></fault></methodResponse>", PG(xmlrpc_error_number), error_type_str, buffer, error_filename, error_lineno);
|
||||
|
|
|
@ -32,8 +32,6 @@
|
|||
#define OB_DEFAULT_HANDLER_NAME "default output handler"
|
||||
|
||||
/* output functions */
|
||||
static int php_ub_body_write(const char *str, uint str_length TSRMLS_DC);
|
||||
static int php_ub_body_write_no_header(const char *str, uint str_length TSRMLS_DC);
|
||||
static int php_b_body_write(const char *str, uint str_length TSRMLS_DC);
|
||||
|
||||
static int php_ob_init(uint initial_size, uint block_size, zval *output_handler, uint chunk_size, zend_bool erase TSRMLS_DC);
|
||||
|
@ -49,7 +47,7 @@ php_output_globals output_globals;
|
|||
#endif
|
||||
|
||||
/* {{{ php_default_output_func */
|
||||
static inline int php_default_output_func(const char *str, uint str_len TSRMLS_DC)
|
||||
PHPAPI int php_default_output_func(const char *str, uint str_len TSRMLS_DC)
|
||||
{
|
||||
fwrite(str, 1, str_len, stderr);
|
||||
return str_len;
|
||||
|
@ -675,7 +673,7 @@ static int php_b_body_write(const char *str, uint str_length TSRMLS_DC)
|
|||
|
||||
/* {{{ php_ub_body_write_no_header
|
||||
*/
|
||||
static int php_ub_body_write_no_header(const char *str, uint str_length TSRMLS_DC)
|
||||
PHPAPI int php_ub_body_write_no_header(const char *str, uint str_length TSRMLS_DC)
|
||||
{
|
||||
int result;
|
||||
|
||||
|
@ -695,7 +693,7 @@ static int php_ub_body_write_no_header(const char *str, uint str_length TSRMLS_D
|
|||
|
||||
/* {{{ php_ub_body_write
|
||||
*/
|
||||
static int php_ub_body_write(const char *str, uint str_length TSRMLS_DC)
|
||||
PHPAPI int php_ub_body_write(const char *str, uint str_length TSRMLS_DC)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
|
|
|
@ -28,6 +28,9 @@ PHPAPI void php_output_startup(void);
|
|||
PHPAPI void php_output_activate(TSRMLS_D);
|
||||
PHPAPI void php_output_set_status(zend_bool status TSRMLS_DC);
|
||||
PHPAPI void php_output_register_constants(TSRMLS_D);
|
||||
PHPAPI int php_default_output_func(const char *str, uint str_len TSRMLS_DC);
|
||||
PHPAPI int php_ub_body_write(const char *str, uint str_length TSRMLS_DC);
|
||||
PHPAPI int php_ub_body_write_no_header(const char *str, uint str_length TSRMLS_DC);
|
||||
PHPAPI int php_body_write(const char *str, uint str_length TSRMLS_DC);
|
||||
PHPAPI int php_header_write(const char *str, uint str_length TSRMLS_DC);
|
||||
PHPAPI int php_start_ob_buffer(zval *output_handler, uint chunk_size, zend_bool erase TSRMLS_DC);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue