]> granicus.if.org Git - php/commitdiff
Apache 2 portion of the fix for bug #25753.
authorIlia Alshanetsky <iliaa@php.net>
Thu, 29 Jan 2004 15:18:26 +0000 (15:18 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 29 Jan 2004 15:18:26 +0000 (15:18 +0000)
sapi/apache2filter/sapi_apache2.c
sapi/apache2handler/sapi_apache2.c

index 8116c463c0eb1b955925da74d2290e518f4422a5..570d01232887b30dbdf76315189713fb447da9af 100644 (file)
@@ -429,11 +429,17 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
        TSRMLS_FETCH();
 
        if (f->r->proxyreq) {
+               zend_try {
+                       zend_ini_deactivate(TSRMLS_C);
+               } zend_end_try();
                return ap_pass_brigade(f->next, bb);
        }
        
        /* handle situations where user turns the engine off */
        if (*p == '0') {
+               zend_try {
+                       zend_ini_deactivate(TSRMLS_C);
+               } zend_end_try();
                return ap_pass_brigade(f->next, bb);
        }
 
@@ -451,11 +457,17 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
        if (ctx == NULL) {
                ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, f->r,
                                         "php failed to get server context");
+               zend_try {
+                       zend_ini_deactivate(TSRMLS_C);
+               } zend_end_try();
         return HTTP_INTERNAL_SERVER_ERROR;
        }
        ctx->f = f; /* save whatever filters are after us in the chain. */
 
        if (ctx->request_processed) {
+               zend_try {
+                       zend_ini_deactivate(TSRMLS_C);
+               } zend_end_try();
                return ap_pass_brigade(f->next, bb);
        }
 
index f6bc71f61b23a17a4b70a208cf1d2fbad5c564dd..e00687f9cb37fc9c8fb563c433e8e3f0186eb9b0 100644 (file)
@@ -459,21 +459,33 @@ static int php_handler(request_rec *r)
        if (strcmp(r->handler, PHP_MAGIC_TYPE) && strcmp(r->handler, PHP_SOURCE_MAGIC_TYPE) && strcmp(r->handler, PHP_SCRIPT)) {
                /* Check for xbithack in this case. */
                if (!AP2(xbithack) || strcmp(r->handler, "text/html") || !(r->finfo.protection & APR_UEXECUTE)) {
+                       zend_try {
+                               zend_ini_deactivate(TSRMLS_C);
+                       } zend_end_try();
                        return DECLINED;
                }
        }
 
        /* handle situations where user turns the engine off */
        if (!AP2(engine)) {
+               zend_try {
+                       zend_ini_deactivate(TSRMLS_C);
+               } zend_end_try();
                return DECLINED;
        }
 
        if (r->finfo.filetype == 0) {
                php_apache_sapi_log_message("script not found or unable to stat");
+               zend_try {
+                               zend_ini_deactivate(TSRMLS_C);
+               } zend_end_try();
                return HTTP_NOT_FOUND;
        }
        if (r->finfo.filetype == APR_DIR) {
                php_apache_sapi_log_message("attempt to invoke directory as script");
+               zend_try {
+                       zend_ini_deactivate(TSRMLS_C);
+               } zend_end_try();
                return HTTP_FORBIDDEN;
        }