diff options
author | Stanislav Malyshev <stas@php.net> | 2013-01-01 20:14:44 -0800 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2013-01-01 21:18:59 -0800 |
commit | 36e19c9cab6cce4e44782563f590c6c4560fb187 (patch) | |
tree | 506c5f2740f7706d7c7674fa5feac556606e0c5e /Zend/zend.c | |
parent | dd288f93e1faa0aff5a22c51be034dfa4edaa0c0 (diff) | |
download | php-git-36e19c9cab6cce4e44782563f590c6c4560fb187.tar.gz |
Bug #43177: If an eval() has a parse error, the overall exit status and return code should not be affected.
Without this fix, a webpage using eval() may return code 500. That might display
fine and the 500 go unnoticed, but using AJAX or wget, the 500 will cause problems.
Diffstat (limited to 'Zend/zend.c')
-rw-r--r-- | Zend/zend.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Zend/zend.c b/Zend/zend.c index 43d3b662a1..fc443d95b9 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -1238,7 +1238,13 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */ va_end(args); if (type == E_PARSE) { - EG(exit_status) = 255; + /* eval() errors do not affect exit_status */ + if (!(EG(current_execute_data) && + EG(current_execute_data)->opline && + EG(current_execute_data)->opline->opcode == ZEND_INCLUDE_OR_EVAL && + EG(current_execute_data)->opline->extended_value == ZEND_EVAL)) { + EG(exit_status) = 255; + } zend_init_compiler_data_structures(TSRMLS_C); } } |