]> granicus.if.org Git - php/commitdiff
Add xbithack support to apache2handler SAPI.
authorJustin Erenkrantz <jerenkrantz@php.net>
Sat, 22 Feb 2003 04:42:34 +0000 (04:42 +0000)
committerJustin Erenkrantz <jerenkrantz@php.net>
Sat, 22 Feb 2003 04:42:34 +0000 (04:42 +0000)
(configuration doesn't work, but that's not something new apparently.)

sapi/apache2handler/sapi_apache2.c

index 23dda7a6f24b4ca307eccaabd744a4c3be9e065b..9918271aa485937ed995c4e03130b3111feecac7 100644 (file)
@@ -481,13 +481,24 @@ static int php_handler(request_rec *r)
        request_rec *parent_req = NULL;
        TSRMLS_FETCH();
 
+       conf = ap_get_module_config(r->per_dir_config, &php4_module);
+       apply_config(conf);
+
        if (strcmp(r->handler, PHP_MAGIC_TYPE) &&
                strcmp(r->handler, PHP_SOURCE_MAGIC_TYPE) &&
                strcmp(r->handler, PHP_SCRIPT)) {
-               return DECLINED;
+               char *xbithack;
+               /* Check for xbithack in this case. */
+               if (strcmp(r->handler, "text/html")) {
+                       return DECLINED;
+               }
+               xbithack = get_php_config(conf, "xbithack", sizeof("xbithack"));
+               if (*xbithack == '\0' || *xbithack == '0'
+                       || !(r->finfo.protection & APR_UEXECUTE)) {
+                       return DECLINED;
+               }
        }
 
-       conf = ap_get_module_config(r->per_dir_config, &php4_module);
        enabled = get_php_config(conf, "engine", sizeof("engine"));
 
        /* handle situations where user turns the engine off */
@@ -515,7 +526,6 @@ static int php_handler(request_rec *r)
                ctx->brigade = brigade;
 
                php_apache_request_ctor(r, ctx TSRMLS_CC);
-               apply_config(conf);
        }
        else {
                parent_req = ctx->r;