cvs: php-src /main php_variables.c /tests/basic bug29971.phpt
| From: | Dmitry Stogov | Date: | Wed, 25 May 2005 17:41:50 +0000 |
| Subject: | cvs: php-src /main php_variables.c /tests/basic bug29971.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-32008@lists.php.net to get a copy of this message | ||
dmitry Wed May 25 13:41:50 2005 EDT
Modified files:
/php-src/main php_variables.c
/php-src/tests/basic bug29971.phpt
Log:
Fixed bug #29971 (variables_order behaviour)
http://cvs.php.net/diff.php/php-src/main/php_variables.c?r1=1.93&r2=1.94&ty=u
Index: php-src/main/php_variables.c
diff -u php-src/main/php_variables.c:1.93 php-src/main/php_variables.c:1.94
--- php-src/main/php_variables.c:1.93 Mon Apr 25 17:18:15 2005
+++ php-src/main/php_variables.c Wed May 25 13:41:50 2005
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_variables.c,v 1.93 2005/04/25 21:18:15 sniper Exp $ */
+/* $Id: php_variables.c,v 1.94 2005/05/25 17:41:50 dmitry Exp $ */
#include <stdio.h>
#include "php.h"
@@ -705,7 +705,15 @@
static zend_bool php_auto_globals_create_server(char *name, uint name_len TSRMLS_DC)
{
- php_register_server_variables(TSRMLS_C);
+ if (strchr(PG(variables_order),'S') || strchr(PG(variables_order),'s')) {
+ php_register_server_variables(TSRMLS_C);
+ } else {
+ zval *server_vars=NULL;
+ ALLOC_ZVAL(server_vars);
+ array_init(server_vars);
+ INIT_PZVAL(server_vars);
+ PG(http_globals)[TRACK_VARS_SERVER] = server_vars;
+ }
zend_hash_update(&EG(symbol_table), name, name_len + 1,
&PG(http_globals)[TRACK_VARS_SERVER], sizeof(zval *), NULL);
PG(http_globals)[TRACK_VARS_SERVER]->refcount++;
@@ -726,7 +734,9 @@
INIT_PZVAL(env_vars);
PG(http_globals)[TRACK_VARS_ENV] = env_vars;
- php_import_environment_variables(PG(http_globals)[TRACK_VARS_ENV] TSRMLS_CC);
+ if (strchr(PG(variables_order),'E') || strchr(PG(variables_order),'e')) {
+ php_import_environment_variables(PG(http_globals)[TRACK_VARS_ENV] TSRMLS_CC);
+ }
zend_hash_update(&EG(symbol_table), name, name_len + 1, &PG(http_globals)[TRACK_VARS_ENV],
sizeof(zval *), NULL);
PG(http_globals)[TRACK_VARS_ENV]->refcount++;
http://cvs.php.net/diff.php/php-src/tests/basic/bug29971.phpt?r1=1.1&r2=1.2&ty=u
Index: php-src/tests/basic/bug29971.phpt
diff -u /dev/null php-src/tests/basic/bug29971.phpt:1.2
--- /dev/null Wed May 25 13:41:50 2005
+++ php-src/tests/basic/bug29971.phpt Wed May 25 13:41:50 2005
@@ -0,0 +1,15 @@
+--TEST--
+Bug #29971 (variables_order behaviour)
+--INI--
+variables_order=GPC
+--FILE--
+<?php
+var_dump($_ENV,$_SERVER);
+var_dump(ini_get("variables_order"));
+?>
+--EXPECT--
+array(0) {
+}
+array(0) {
+}
+string(3) "GPC"