cvs: php4 /sapi/apache2filter sapi_apache2.c /sapi/apache2handler sapi_apache2.c

From: Date: Tue, 13 May 2003 19:33:36 +0000
Subject: cvs: php4 /sapi/apache2filter sapi_apache2.c /sapi/apache2handler sapi_apache2.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-20863@lists.php.net to get a copy of this message
moriyoshi Tue May 13 15:33:36 2003 EDT Modified files: /php4/sapi/apache2filter sapi_apache2.c /php4/sapi/apache2handler sapi_apache2.c Log: Fixed bug #23610 Index: php4/sapi/apache2filter/sapi_apache2.c diff -u php4/sapi/apache2filter/sapi_apache2.c:1.110 php4/sapi/apache2filter/sapi_apache2.c:1.111 --- php4/sapi/apache2filter/sapi_apache2.c:1.110 Tue Apr 29 20:47:08 2003 +++ php4/sapi/apache2filter/sapi_apache2.c Tue May 13 15:33:36 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: sapi_apache2.c,v 1.110 2003/04/30 00:47:08 iliaa Exp $ */ +/* $Id: sapi_apache2.c,v 1.111 2003/05/13 19:33:36 moriyoshi Exp $ */ #include <fcntl.h> @@ -224,6 +224,12 @@ APR_ARRAY_FOREACH_CLOSE() php_register_variable("PHP_SELF", ctx->r->uri, track_vars_array TSRMLS_CC); + + /* If PATH_TRANSLATED doesn't exist, copy it from SCRIPT_FILENAME */ + if (!zend_hash_exists(Z_ARRVAL_P(track_vars_array), "PATH_TRANSLATED", sizeof("PATH_TRANSLATED")) + && zend_hash_find(Z_ARRVAL_P(track_vars_array), "SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME"), (void **) &path_translated_zv) == SUCCESS) { + php_register_variable("PATH_TRANSLATED", Z_STRVAL_PP(path_translated_zv), track_vars_array TSRMLS_CC); + } } static void @@ -396,7 +402,15 @@ apr_table_unset(f->r->headers_out, "Expires"); apr_table_unset(f->r->headers_out, "ETag"); apr_table_unset(f->r->headers_in, "Connection"); +<<<<<<< sapi_apache2.c +<<<<<<< sapi_apache2.c + if (!PG(safe_mode) || (PG(safe_mode) && ap_auth_type() == NULL)) { +======= + if (!PG(safe_mode) || (PG(safe_mode) && !ap_auth_type(r))) { +>>>>>>> 1.109 +======= if (!PG(safe_mode) || (PG(safe_mode) && !ap_auth_type(f->r))) { +>>>>>>> 1.110 auth = apr_table_get(f->r->headers_in, "Authorization"); php_handle_auth_data(auth TSRMLS_CC); } else { Index: php4/sapi/apache2handler/sapi_apache2.c diff -u php4/sapi/apache2handler/sapi_apache2.c:1.16 php4/sapi/apache2handler/sapi_apache2.c:1.17 --- php4/sapi/apache2handler/sapi_apache2.c:1.16 Wed May 7 10:11:58 2003 +++ php4/sapi/apache2handler/sapi_apache2.c Tue May 13 15:33:36 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: sapi_apache2.c,v 1.16 2003/05/07 14:11:58 moriyoshi Exp $ */ +/* $Id: sapi_apache2.c,v 1.17 2003/05/13 19:33:36 moriyoshi Exp $ */ #include <fcntl.h> @@ -227,13 +227,20 @@ php_struct *ctx = SG(server_context); const apr_array_header_t *arr = apr_table_elts(ctx->r->subprocess_env); char *key, *val; - + zval **path_translated_zv; + APR_ARRAY_FOREACH_OPEN(arr, key, val) if (!val) val = empty_string; php_register_variable(key, val, track_vars_array TSRMLS_CC); APR_ARRAY_FOREACH_CLOSE() php_register_variable("PHP_SELF", ctx->r->uri, track_vars_array TSRMLS_CC); + + /* If PATH_TRANSLATED doesn't exist, copy it from SCRIPT_FILENAME */ + if (!zend_hash_exists(Z_ARRVAL_P(track_vars_array), "PATH_TRANSLATED", sizeof("PATH_TRANSLATED")) + && zend_hash_find(Z_ARRVAL_P(track_vars_array), "SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME"), (void **) &path_translated_zv) == SUCCESS) { + php_register_variable("PATH_TRANSLATED", Z_STRVAL_PP(path_translated_zv), track_vars_array TSRMLS_CC); + } } static void @@ -424,7 +431,11 @@ apr_table_unset(r->headers_out, "Expires"); apr_table_unset(r->headers_out, "ETag"); apr_table_unset(r->headers_in, "Connection"); +<<<<<<< sapi_apache2.c + if (!PG(safe_mode) || (PG(safe_mode) && ap_auth_type() == NULL)) { +======= if (!PG(safe_mode) || (PG(safe_mode) && !ap_auth_type(r))) { +>>>>>>> 1.15 auth = apr_table_get(r->headers_in, "Authorization"); php_handle_auth_data(auth TSRMLS_CC); ctx->r->user = apr_pstrdup(ctx->r->pool, SG(request_info).auth_user);

« previous php.cvs (#20863) next »