cvs: php4(PHP_4_3) /sapi/apache2filter sapi_apache2.c /sapi/apache2handler sapi_apache2.c
| From: | Moriyoshi Koizumi | Date: | Tue, 13 May 2003 19:38:04 +0000 |
| Subject: | cvs: php4(PHP_4_3) /sapi/apache2filter sapi_apache2.c /sapi/apache2handler sapi_apache2.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-20865@lists.php.net to get a copy of this message | ||
moriyoshi Tue May 13 15:38:04 2003 EDT
Modified files: (Branch: PHP_4_3)
/php4/sapi/apache2filter sapi_apache2.c
/php4/sapi/apache2handler sapi_apache2.c
Log:
MFH(r-1.112, r-1.18): fixed bug #23610
Index: php4/sapi/apache2filter/sapi_apache2.c
diff -u php4/sapi/apache2filter/sapi_apache2.c:1.91.2.9
php4/sapi/apache2filter/sapi_apache2.c:1.91.2.10
--- php4/sapi/apache2filter/sapi_apache2.c:1.91.2.9 Tue Apr 29 20:47:20 2003
+++ php4/sapi/apache2filter/sapi_apache2.c Tue May 13 15:38:03 2003
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sapi_apache2.c,v 1.91.2.9 2003/04/30 00:47:20 iliaa Exp $ */
+/* $Id: sapi_apache2.c,v 1.91.2.10 2003/05/13 19:38:03 moriyoshi Exp $ */
#include <fcntl.h>
@@ -212,6 +212,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
@@ -388,6 +394,7 @@
apr_table_unset(f->r->headers_out, "Expires");
apr_table_unset(f->r->headers_out, "ETag");
apr_table_unset(f->r->headers_in, "Connection");
+
if (!PG(safe_mode) || (PG(safe_mode) && !ap_auth_type(f->r))) {
auth = apr_table_get(f->r->headers_in, "Authorization");
php_handle_auth_data(auth TSRMLS_CC);
Index: php4/sapi/apache2handler/sapi_apache2.c
diff -u php4/sapi/apache2handler/sapi_apache2.c:1.1.2.9
php4/sapi/apache2handler/sapi_apache2.c:1.1.2.10
--- php4/sapi/apache2handler/sapi_apache2.c:1.1.2.9 Wed May 7 10:12:57 2003
+++ php4/sapi/apache2handler/sapi_apache2.c Tue May 13 15:38:04 2003
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sapi_apache2.c,v 1.1.2.9 2003/05/07 14:12:57 moriyoshi Exp $ */
+/* $Id: sapi_apache2.c,v 1.1.2.10 2003/05/13 19:38:04 moriyoshi Exp $ */
#include <fcntl.h>
@@ -225,13 +225,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