]> granicus.if.org Git - php/commitdiff
Fixed bug #24958 (Incorrect handling of 404s)
authorIlia Alshanetsky <iliaa@php.net>
Wed, 6 Aug 2003 22:33:18 +0000 (22:33 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 6 Aug 2003 22:33:18 +0000 (22:33 +0000)
sapi/apache2handler/sapi_apache2.c

index 2f399303de9cfbbd20abb1df8cc52f82e04af15d..4982a740d4b66c2f848d36e881881be69639fe00 100644 (file)
@@ -468,6 +468,15 @@ static int php_handler(request_rec *r)
                return DECLINED;
        }
 
+       if (r->finfo.filetype == 0) {
+               php_apache_sapi_log_message("script not found or unable to stat");
+               return HTTP_NOT_FOUND;
+       }
+       if (r->finfo.filetype == APR_DIR) {
+               php_apache_sapi_log_message("attempt to invoke directory as script");
+               return HTTP_FORBIDDEN;
+       }
+
        /* Setup the CGI variables if this is the main request */
        if (r->main == NULL || 
                /* .. or if the sub-request envinronment differs from the main-request. */ 
@@ -498,15 +507,6 @@ static int php_handler(request_rec *r)
                brigade = ctx->brigade;
        }
 
-       if (r->finfo.filetype == 0) {
-               php_apache_sapi_log_message("script not found or unable to stat");
-               return HTTP_NOT_FOUND;
-       }
-       if (r->finfo.filetype == APR_DIR) {
-               php_apache_sapi_log_message("attempt to invoke directory as script");
-               return HTTP_FORBIDDEN;
-       }
-
        if (AP2(last_modified)) {
                ap_update_mtime(r, r->finfo.mtime);
                ap_set_last_modified(r);