Skip to content

Commit

Permalink
Fix bug 76596: phpdbg supports display_errors=stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
kabel authored and krakjoe committed Jan 30, 2019
1 parent cbc5a14 commit 3890c8b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ PHP NEWS
. Fixed bug #77273 (array_walk_recursive corrupts value types leading to PDO
failure). (Nikita)

- phpdbg:
. Fixed bug #76596 (phpdbg support for display_errors=stderr). (kabel)

- Sockets:
. Fixed bug #76839 (socket_recvfrom may return an invalid 'from' address
on MacOS). (Michael Meyer)
Expand Down
4 changes: 2 additions & 2 deletions main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ static PHP_INI_DISP(display_errors_mode)
mode = php_get_display_errors_mode(tmp_value, tmp_value_length);

/* Display 'On' for other SAPIs instead of STDOUT or STDERR */
cgi_or_cli = (!strcmp(sapi_module.name, "cli") || !strcmp(sapi_module.name, "cgi"));
cgi_or_cli = (!strcmp(sapi_module.name, "cli") || !strcmp(sapi_module.name, "cgi") || !strcmp(sapi_module.name, "phpdbg"));

switch (mode) {
case PHP_DISPLAY_ERRORS_STDERR:
Expand Down Expand Up @@ -1181,7 +1181,7 @@ static ZEND_COLD void php_error_cb(int type, const char *error_filename, const u
}
} else {
/* Write CLI/CGI errors to stderr if display_errors = "stderr" */
if ((!strcmp(sapi_module.name, "cli") || !strcmp(sapi_module.name, "cgi")) &&
if ((!strcmp(sapi_module.name, "cli") || !strcmp(sapi_module.name, "cgi") || !strcmp(sapi_module.name, "phpdbg")) &&
PG(display_errors) == PHP_DISPLAY_ERRORS_STDERR
) {
fprintf(stderr, "%s: %s in %s on line %u\n", error_type_str, buffer, error_filename, error_lineno);
Expand Down

0 comments on commit 3890c8b

Please sign in to comment.