]> granicus.if.org Git - php/commitdiff
fix bug #34581 (crash with mod_rewrite)
authorAntony Dovgal <tony2001@php.net>
Wed, 12 Oct 2005 21:24:09 +0000 (21:24 +0000)
committerAntony Dovgal <tony2001@php.net>
Wed, 12 Oct 2005 21:24:09 +0000 (21:24 +0000)
NEWS
sapi/apache2handler/sapi_apache2.c

diff --git a/NEWS b/NEWS
index 71c128ac4ae1a3e14d84a99e1f56bdecb111a6d9..c862ed0791c59481f33e9bee08c3c3a67c8050e1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -79,6 +79,7 @@ PHP                                                                        NEWS
 - Fixed bug #34590 (User defined PDOStatement class can't implement methods).
   (Marcus)
 - Fixed bug #34584 (Segfault with SPL autoload handler). (Marcus)
+- Fixed bug #34581 (crash with mod_rewrite). (Tony, Ilia)
 - Fixed bug #34565 (mb_send_mail does not fetch mail.force_extra_parameters).
   (Marco, Ilia)
 - Fixed bug #34557 (php -m exits with "error" 1). (Johannes)
index 88e48cc37b11e02c653c537ae939b30ca7f920c1..06b7bd912cd48c282430147688cd0633521f2937 100644 (file)
@@ -473,6 +473,7 @@ normal:
                ctx->r = r;
                ctx = NULL; /* May look weird to null it here, but it is to catch the right case in the first_try later on */
        } else {
+               parent_req = ctx->r;
                ctx->r = r;
        }
        apply_config(conf);
@@ -531,7 +532,15 @@ zend_first_try {
                        zend_bailout();
                }
        } else {
-               parent_req = ctx->r;
+               if (!parent_req) {
+                       parent_req = ctx->r;
+               }
+               if (parent_req && strcmp(parent_req->handler, PHP_MAGIC_TYPE) && strcmp(parent_req->handler, PHP_SOURCE_MAGIC_TYPE) && strcmp(parent_req->handler, PHP_SCRIPT)) {
+                       if (php_apache_request_ctor(r, ctx TSRMLS_CC)!=SUCCESS) {
+                               zend_bailout();
+                       }
+               }
+               
                /* check if comming due to ErrorDocument */
                if (parent_req && parent_req->status != HTTP_OK) {
                        parent_req = NULL;