diff options
author | twosee <twose@qq.com> | 2020-09-10 17:36:04 +0800 |
---|---|---|
committer | twosee <twose@qq.com> | 2020-09-10 17:36:04 +0800 |
commit | bd1d11d352ddfb2c376060d7e7b282636dce1605 (patch) | |
tree | a9d958862030ba3f5f3758fd05e3c1bc9ab5c21f /sapi/cli | |
parent | 298d2db62e9e9c13edc495a49cde2a928f8e4a5b (diff) | |
download | php-git-bd1d11d352ddfb2c376060d7e7b282636dce1605.tar.gz |
Simplify error type filter
Closes GH-6049.
Diffstat (limited to 'sapi/cli')
-rw-r--r-- | sapi/cli/php_cli_server.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index 64e29e8524..337886bcd3 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -1177,19 +1177,13 @@ static void php_cli_server_log_response(php_cli_server_client *client, int statu zend_bool append_error_message = 0; if (PG(last_error_message)) { - switch (PG(last_error_type)) { - case E_ERROR: - case E_CORE_ERROR: - case E_COMPILE_ERROR: - case E_USER_ERROR: - case E_PARSE: - if (status == 200) { - /* the status code isn't changed by a fatal error, so fake it */ - effective_status = 500; - } + if (PG(last_error_type) & E_FATAL_ERRORS) { + if (status == 200) { + /* the status code isn't changed by a fatal error, so fake it */ + effective_status = 500; + } - append_error_message = 1; - break; + append_error_message = 1; } } |