diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2005-08-18 01:11:13 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2005-08-18 01:11:13 +0000 |
commit | 9fc26c42c2d301fe955c3d2e0ab2c94dd46702f4 (patch) | |
tree | d4497399f794888f65d9e264188d0d306e7d8335 /sapi | |
parent | cac4e22635972e4faf6d2eae5313944e0c142848 (diff) | |
download | php-git-9fc26c42c2d301fe955c3d2e0ab2c94dd46702f4.tar.gz |
Fixed bug #33987 (php script as ErrorDocument causes crash in Apache 2).
Diffstat (limited to 'sapi')
-rw-r--r-- | sapi/apache2handler/sapi_apache2.c | 6 |
1 files changed, 6 insertions, 0 deletions
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; } |