]> granicus.if.org Git - php/commitdiff
Fixed bug #33987 (php script as ErrorDocument causes crash in Apache 2).
authorIlia Alshanetsky <iliaa@php.net>
Thu, 18 Aug 2005 01:11:13 +0000 (01:11 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 18 Aug 2005 01:11:13 +0000 (01:11 +0000)
sapi/apache2handler/sapi_apache2.c

index 11852789665215458a0d950efb94f00b11279628..c5734c0116d1adc9031a8fd2a9cab3e9c8662f2e 100644 (file)
@@ -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;
        }