summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/standard/info.c16
-rw-r--r--ext/standard/post.c1
-rw-r--r--mod_php4.c4
3 files changed, 18 insertions, 3 deletions
diff --git a/ext/standard/info.c b/ext/standard/info.c
index 87c52a7ce5..f125662073 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -191,7 +191,16 @@ PHPAPI void php_print_info(int flag)
if (zend_hash_find(&EG(symbol_table), "HTTP_GET_VARS", sizeof("HTTP_GET_VARS"), (void **) &data) != FAILURE) {
zend_hash_internal_pointer_reset((*data)->value.ht);
while (zend_hash_get_current_data((*data)->value.ht, (void **) &tmp) == SUCCESS) {
- convert_to_string(*tmp);
+ zval tmp2, *value_ptr;
+
+ if ((*tmp)->type != IS_STRING) {
+ tmp2 = **tmp;
+ zval_copy_ctor(&tmp2);
+ convert_to_string(&tmp2);
+ value_ptr = &tmp2;
+ } else {
+ value_ptr = *tmp;
+ }
PUTS("<tr><td bgcolor=\"" PHP_ENTRY_NAME_COLOR "\"><b>HTTP_GET_VARS[\"");
switch (zend_hash_get_current_key((*data)->value.ht, &string_key, &num_key)) {
case HASH_KEY_IS_STRING:
@@ -203,9 +212,12 @@ PHPAPI void php_print_info(int flag)
break;
}
PUTS("\"]</b></td><td bgcolor=\"" PHP_CONTENTS_COLOR "\">");
- PUTS((*tmp)->value.str.val); /* This could be "Array" - too ugly to expand that for now */
+ PUTS(value_ptr->value.str.val); /* This could be "Array" - too ugly to expand that for now */
PUTS("</td></tr>\n");
zend_hash_move_forward((*data)->value.ht);
+ if (value_ptr==&tmp2) {
+ zval_dtor(value_ptr);
+ }
}
}
if (zend_hash_find(&EG(symbol_table), "HTTP_POST_VARS", sizeof("HTTP_POST_VARS"), (void **) &data) != FAILURE) {
diff --git a/ext/standard/post.c b/ext/standard/post.c
index 2599690222..8b37dc8ed2 100644
--- a/ext/standard/post.c
+++ b/ext/standard/post.c
@@ -295,6 +295,7 @@ void php_parse_gpc_data2(char *val, char *var, pval *track_vars_array ELS_DC PLS
if (symtable2 && top_gpc_p) {
zend_hash_update(symtable2, var, var_len+1, top_gpc_p, sizeof(zval *), NULL);
+ (*top_gpc_p)->refcount++;
}
}
diff --git a/mod_php4.c b/mod_php4.c
index f4e5d9dc5c..77fff0e5d4 100644
--- a/mod_php4.c
+++ b/mod_php4.c
@@ -36,6 +36,7 @@
#include "php.h"
#include "php_ini.h"
+#include "php_globals.h"
#include "SAPI.h"
#include "main.h"
@@ -241,6 +242,7 @@ static void init_request_info(SLS_D)
static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry)
{
php_alter_ini_entry(per_dir_entry->key, per_dir_entry->key_length+1, per_dir_entry->value, per_dir_entry->value_length+1, per_dir_entry->type);
+ return 0;
}
@@ -488,7 +490,7 @@ void php_init_handler(server_rec *s, pool *p)
apache_php_initialized = 1;
}
#if MODULE_MAGIC_NUMBER >= 19980527
- if (INI_INT(PG(expose_php)) {
+ if (PG(expose_php)) {
ap_add_version_component("PHP/" PHP_VERSION);
}
#endif