diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2005-08-18 01:14:42 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2005-08-18 01:14:42 +0000 |
commit | e134382a71f22072809f1a26253a3d220426ef49 (patch) | |
tree | 41ac9ce657b3cfee09b7ca93d8fc5789f2b6a311 | |
parent | 94c7fd06034017d4c38e0b6c9a77bef31bd0c74e (diff) | |
download | php-git-e134382a71f22072809f1a26253a3d220426ef49.tar.gz |
MFH: Fixed bug #33987 (php script as ErrorDocument causes crash in Apache 2).
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | sapi/apache2handler/sapi_apache2.c | 6 |
2 files changed, 8 insertions, 0 deletions
@@ -27,6 +27,8 @@ PHP NEWS - Fixed bug #33996 (No information given for fatal error on passing invalid value to typed argument). (Dmitry) - Fixed bug #33989 (extract($GLOBALS,EXTR_REFS) crashes PHP). (Dmitry) +- Fixed bug #33987 (php script as ErrorDocument causes crash in Apache 2). + (Ilia) - Fixed bug #33967 (misuse of Exception constructor doesn't display errorfile). (Jani) - Fixed bug #33958 (duplicate cookies and magic_quotes=off may cause a crash). diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c index 1185278966..c5734c0116 100644 --- a/sapi/apache2handler/sapi_apache2.c +++ b/sapi/apache2handler/sapi_apache2.c @@ -458,6 +458,7 @@ static int php_handler(request_rec *r) /* apply_config() needs r in some cases, so allocate server_context early */ ctx = SG(server_context); if (ctx == NULL) { +normal: ctx = SG(server_context) = apr_pcalloc(r->pool, sizeof(*ctx)); /* register a cleanup so we clear out the SG(server_context) * after each request. Note: We pass in the pointer to the @@ -536,6 +537,11 @@ zend_first_try { } } else { parent_req = ctx->r; + /* check if comming due to ErrorDocument */ + if (parent_req != HTTP_OK) { + parent_req = NULL; + goto normal; + } ctx->r = r; brigade = ctx->brigade; } |