Skip to content

Increase .idea on gitignore and increase early return on php display error #6760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -286,3 +286,5 @@ tmp-php.ini
!/ext/fileinfo/magicdata.patch
!/ext/pcre/pcre2lib/config.h
!/win32/build/Makefile

.idea
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.idea

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll remove.

33 changes: 19 additions & 14 deletions main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,20 +410,25 @@ static zend_uchar php_get_display_errors_mode(char *value, size_t value_length)
}

if (value_length == 2 && !strcasecmp("on", value)) {
mode = PHP_DISPLAY_ERRORS_STDOUT;
} else if (value_length == 3 && !strcasecmp("yes", value)) {
mode = PHP_DISPLAY_ERRORS_STDOUT;
} else if (value_length == 4 && !strcasecmp("true", value)) {
mode = PHP_DISPLAY_ERRORS_STDOUT;
} else if (value_length == 6 && !strcasecmp(value, "stderr")) {
mode = PHP_DISPLAY_ERRORS_STDERR;
} else if (value_length == 6 && !strcasecmp(value, "stdout")) {
mode = PHP_DISPLAY_ERRORS_STDOUT;
} else {
ZEND_ATOL(mode, value);
if (mode && mode != PHP_DISPLAY_ERRORS_STDOUT && mode != PHP_DISPLAY_ERRORS_STDERR) {
mode = PHP_DISPLAY_ERRORS_STDOUT;
}
return PHP_DISPLAY_ERRORS_STDOUT;
}
if (value_length == 3 && !strcasecmp("yes", value)) {
return PHP_DISPLAY_ERRORS_STDOUT;
}

if (value_length == 4 && !strcasecmp("true", value)) {
return PHP_DISPLAY_ERRORS_STDOUT;
}
if (value_length == 6 && !strcasecmp(value, "stderr")) {
return PHP_DISPLAY_ERRORS_STDERR;
}
if (value_length == 6 && !strcasecmp(value, "stdout")) {
return PHP_DISPLAY_ERRORS_STDOUT;
}

ZEND_ATOL(mode, value);
if (mode && mode != PHP_DISPLAY_ERRORS_STDOUT && mode != PHP_DISPLAY_ERRORS_STDERR) {
return PHP_DISPLAY_ERRORS_STDOUT;
}

return mode;
Expand Down