summaryrefslogtreecommitdiff
path: root/sapi/apache2handler/sapi_apache2.c
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2005-10-12 21:24:09 +0000
committerAntony Dovgal <tony2001@php.net>2005-10-12 21:24:09 +0000
commitf4371b9cc68b6a1a2f4e03405170e24cf9f8fa9d (patch)
tree2b3c770b7d25939b0af67ef822c820e4e8ef3535 /sapi/apache2handler/sapi_apache2.c
parent4acffedc6b3c8eb2e93088aec449f8baea2299ac (diff)
downloadphp-git-f4371b9cc68b6a1a2f4e03405170e24cf9f8fa9d.tar.gz
fix bug #34581 (crash with mod_rewrite)
Diffstat (limited to 'sapi/apache2handler/sapi_apache2.c')
-rw-r--r--sapi/apache2handler/sapi_apache2.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c
index 88e48cc37b..06b7bd912c 100644
--- a/sapi/apache2handler/sapi_apache2.c
+++ b/sapi/apache2handler/sapi_apache2.c
@@ -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;