pajoye Tue Mar 7 00:20:54 2006 UTC
Modified files:
/php-src NEWS php.ini-dist php.ini-recommended
/php-src/ext/mbstring mb_gpc.c mb_gpc.h mbstring.c
/php-src/ext/mbstring/tests mb_parse_str.phpt mb_parse_str02.phpt
/php-src/ext/session php_session.h session.c
/php-src/ext/session/tests 001.phpt 003.phpt 004.phpt 005.phpt
006.phpt 007.phpt 008-php4.2.3.phpt
008.phpt 009.phpt 010.phpt 011.phpt
012.phpt 013.phpt 014.phpt 019.phpt
bug24592.phpt bug26862.phpt
/php-src/main main.c php_globals.h php_variables.c rfc1867.c
/php-src/sapi/apache mod_php5.c
/php-src/sapi/apache_hooks mod_php5.c sapi_apache.c
Log:
- remove register_globals support (aka "Kill the f***ing thing" :)
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2094&r2=1.2095&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2094 php-src/NEWS:1.2095
--- php-src/NEWS:1.2094 Mon Mar 6 14:27:45 2006
+++ php-src/NEWS Tue Mar 7 00:20:53 2006
@@ -2,6 +2,9 @@
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 6.0
- Unicode support. (Andrei, Dmitry, et al)
+- Droped register_globals support (Pierre)
+ - session_register, session_unregister and session_is_registered removed they
+ depend on register_globals
- Cleaned CGI code. Now FastCGI can not be disabled. See sapi/cgi/CHANGES
for more details. (Dmitry)
- Removed support for "continue" and "break" operators with non-constant
http://cvs.php.net/viewcvs.cgi/php-src/php.ini-dist?r1=1.245&r2=1.246&diff_format=u
Index: php-src/php.ini-dist
diff -u php-src/php.ini-dist:1.245 php-src/php.ini-dist:1.246
--- php-src/php.ini-dist:1.245 Wed Feb 8 23:47:01 2006
+++ php-src/php.ini-dist Tue Mar 7 00:20:53 2006
@@ -388,17 +388,6 @@
; values override older values.
variables_order = "EGPCS"
-; Whether or not to register the EGPCS variables as global variables. You may
-; want to turn this off if you don't want to clutter your scripts' global scope
-; with user data. This makes most sense when coupled with track_vars - in
which
-; case you can access all of the GPC variables through the $HTTP_*_VARS[],
-; variables.
-;
-; You should do your best to write your scripts so that they do not require
-; register_globals to be on; Using form variables as globals can easily lead
-; to possible security problems, if the code is not very well thought of.
-register_globals = Off
-
; Whether or not to register the old-style input arrays, HTTP_GET_VARS
; and friends. If you're not using them, it's recommended to turn them off,
; for performance reasons.
@@ -412,8 +401,8 @@
; When enabled, the SERVER and ENV variables are created when they're first
; used (Just In Time) instead of when the script starts. If these variables
; are not used within a script, having this directive on will result in a
-; performance gain. The PHP directives register_globals, register_long_arrays,
-; and register_argc_argv must be disabled for this directive to have any
affect.
+; performance gain. The PHP directives register_long_arrays and
+; register_argc_argv must be disabled for this directive to have any affect.
auto_globals_jit = On
; Maximum size of POST data that PHP will accept.
http://cvs.php.net/viewcvs.cgi/php-src/php.ini-recommended?r1=1.194&r2=1.195&diff_format=u
Index: php-src/php.ini-recommended
diff -u php-src/php.ini-recommended:1.194 php-src/php.ini-recommended:1.195
--- php-src/php.ini-recommended:1.194 Wed Feb 8 23:47:01 2006
+++ php-src/php.ini-recommended Tue Mar 7 00:20:53 2006
@@ -67,18 +67,6 @@
; PHP. Please make sure you read what's different, and modify your scripts
; accordingly, if you decide to use this file instead.
;
-; - register_globals = Off [Security, Performance]
-; Global variables are no longer registered for input data (POST, GET,
cookies,
-; environment and other server variables). Instead of using $foo, you
must use
-; you can use $_REQUEST["foo"] (includes any variable that arrives through
the
-; request, namely, POST, GET and cookie variables), or use one of the
specific
-; $_GET["foo"], $_POST["foo"], $_COOKIE["foo"] or $_FILES["foo"], depending
-; on where the input originates. Also, you can look at the
-; import_request_variables() function.
-; Note that register_globals is going to be depracated (i.e., turned off by
-; default) in the next version of PHP, because it often leads to security
bugs.
-; Read http://php.net/manual/en/security.registerglobals.php for further
-; information.
; - register_long_arrays = Off [Performance]
; Disables registration of the older (and deprecated) long predefined array
; variables ($HTTP_*_VARS). Instead, use the superglobals that were
@@ -446,17 +434,6 @@
; values override older values.
variables_order = "GPCS"
-; Whether or not to register the EGPCS variables as global variables. You may
-; want to turn this off if you don't want to clutter your scripts' global scope
-; with user data. This makes most sense when coupled with track_vars - in
which
-; case you can access all of the GPC variables through the $HTTP_*_VARS[],
-; variables.
-;
-; You should do your best to write your scripts so that they do not require
-; register_globals to be on; Using form variables as globals can easily lead
-; to possible security problems, if the code is not very well thought of.
-register_globals = Off
-
; Whether or not to register the old-style input arrays, HTTP_GET_VARS
; and friends. If you're not using them, it's recommended to turn them off,
; for performance reasons.
@@ -470,8 +447,8 @@
; When enabled, the SERVER and ENV variables are created when they're first
; used (Just In Time) instead of when the script starts. If these variables
; are not used within a script, having this directive on will result in a
-; performance gain. The PHP directives register_globals, register_long_arrays,
-; and register_argc_argv must be disabled for this directive to have any
affect.
+; performance gain. The PHP directives register_long_arrays and
+; register_argc_argv must be disabled for this directive to have any affect.
auto_globals_jit = On
; Maximum size of POST data that PHP will accept.
@@ -1005,8 +982,8 @@
; cd /path/to/sessions; find -cmin +24 | xargs rm
; PHP 4.2 and less have an undocumented feature/bug that allows you to
-; to initialize a session variable in the global scope, albeit register_globals
-; is disabled. PHP 4.3 and later will warn you, if this feature is used.
+; to initialize a session variable in the global scope.
+; PHP 4.3 and later will warn you, if this feature is used.
; You can disable the feature and the warning separately. At this time,
; the warning is only displayed, if bug_compat_42 is enabled.
http://cvs.php.net/viewcvs.cgi/php-src/ext/mbstring/mb_gpc.c?r1=1.19&r2=1.20&diff_format=u
Index: php-src/ext/mbstring/mb_gpc.c
diff -u php-src/ext/mbstring/mb_gpc.c:1.19 php-src/ext/mbstring/mb_gpc.c:1.20
--- php-src/ext/mbstring/mb_gpc.c:1.19 Sun Jan 1 13:09:51 2006
+++ php-src/ext/mbstring/mb_gpc.c Tue Mar 7 00:20:53 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mb_gpc.c,v 1.19 2006/01/01 13:09:51 sniper Exp $ */
+/* $Id: mb_gpc.c,v 1.20 2006/03/07 00:20:53 pajoye Exp $ */
/* {{{ includes */
#ifdef HAVE_CONFIG_H
@@ -146,7 +146,6 @@
info.data_type = arg;
info.separator = separator;
- info.force_register_globals = 0;
info.report_errors = 0;
info.to_encoding = MBSTRG(internal_encoding);
info.to_language = MBSTRG(language);
@@ -203,14 +202,6 @@
mbfl_string_init_set(&resvar, info->to_language, info->to_encoding);
mbfl_string_init_set(&resval, info->to_language, info->to_encoding);
- /* register_globals stuff
- * XXX: this feature is going to be deprecated? */
-
- if (info->force_register_globals) {
- prev_rg_state = PG(register_globals);
- PG(register_globals) = 1;
- }
-
if (!res || *res == '\0') {
goto out;
}
@@ -340,11 +331,6 @@
}
out:
- /* register_global stuff */
- if (info->force_register_globals) {
- PG(register_globals) = prev_rg_state;
- }
-
if (convd != NULL) {
mbfl_buffer_converter_delete(convd);
}
@@ -369,7 +355,6 @@
info.data_type = PARSE_POST;
info.separator = "&";
- info.force_register_globals = 0;
info.report_errors = 0;
info.to_encoding = MBSTRG(internal_encoding);
info.to_language = MBSTRG(language);
http://cvs.php.net/viewcvs.cgi/php-src/ext/mbstring/mb_gpc.h?r1=1.6&r2=1.7&diff_format=u
Index: php-src/ext/mbstring/mb_gpc.h
diff -u php-src/ext/mbstring/mb_gpc.h:1.6 php-src/ext/mbstring/mb_gpc.h:1.7
--- php-src/ext/mbstring/mb_gpc.h:1.6 Sun Jan 1 13:09:51 2006
+++ php-src/ext/mbstring/mb_gpc.h Tue Mar 7 00:20:53 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mb_gpc.h,v 1.6 2006/01/01 13:09:51 sniper Exp $ */
+/* $Id: mb_gpc.h,v 1.7 2006/03/07 00:20:53 pajoye Exp $ */
/* {{{ includes */
#ifdef HAVE_CONFIG_H
@@ -32,7 +32,6 @@
typedef struct _php_mb_encoding_handler_info_t {
int data_type;
const char *separator;
- unsigned int force_register_globals: 1;
unsigned int report_errors: 1;
enum mbfl_no_language to_language;
enum mbfl_no_encoding to_encoding;
http://cvs.php.net/viewcvs.cgi/php-src/ext/mbstring/mbstring.c?r1=1.240&r2=1.241&diff_format=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.240
php-src/ext/mbstring/mbstring.c:1.241
--- php-src/ext/mbstring/mbstring.c:1.240 Fri Mar 3 20:41:52 2006
+++ php-src/ext/mbstring/mbstring.c Tue Mar 7 00:20:53 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mbstring.c,v 1.240 2006/03/03 20:41:52 yohgaki Exp $ */
+/* $Id: mbstring.c,v 1.241 2006/03/07 00:20:53 pajoye Exp $ */
/*
* PHP 4 Multibyte String module "mbstring"
@@ -1401,7 +1401,6 @@
info.data_type = PARSE_STRING;
info.separator = PG(arg_separator).input;
- info.force_register_globals = (track_vars_array == NULL);
info.report_errors = 1;
info.to_encoding = MBSTRG(current_internal_encoding);
info.to_language = MBSTRG(current_language);
http://cvs.php.net/viewcvs.cgi/php-src/ext/mbstring/tests/mb_parse_str.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/mbstring/tests/mb_parse_str.phpt
diff -u php-src/ext/mbstring/tests/mb_parse_str.phpt:1.2
php-src/ext/mbstring/tests/mb_parse_str.phpt:1.3
--- php-src/ext/mbstring/tests/mb_parse_str.phpt:1.2 Sat Mar 29 07:13:47 2003
+++ php-src/ext/mbstring/tests/mb_parse_str.phpt Tue Mar 7 00:20:53 2006
@@ -4,7 +4,6 @@
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
--INI--
arg_separator.input=&
-register_globals=0
--FILE--
<?php
$queries = array(
http://cvs.php.net/viewcvs.cgi/php-src/ext/mbstring/tests/mb_parse_str02.phpt?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/mbstring/tests/mb_parse_str02.phpt
diff -u php-src/ext/mbstring/tests/mb_parse_str02.phpt:1.3
php-src/ext/mbstring/tests/mb_parse_str02.phpt:1.4
--- php-src/ext/mbstring/tests/mb_parse_str02.phpt:1.3 Sat Mar 29 07:13:47 2003
+++ php-src/ext/mbstring/tests/mb_parse_str02.phpt Tue Mar 7 00:20:53 2006
@@ -4,7 +4,6 @@
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
--INI--
arg_separator.input=&#
-register_globals=0
--FILE--
<?php
$queries = array(
http://cvs.php.net/viewcvs.cgi/php-src/ext/session/php_session.h?r1=1.104&r2=1.105&diff_format=u
Index: php-src/ext/session/php_session.h
diff -u php-src/ext/session/php_session.h:1.104
php-src/ext/session/php_session.h:1.105
--- php-src/ext/session/php_session.h:1.104 Tue Feb 21 20:12:42 2006
+++ php-src/ext/session/php_session.h Tue Mar 7 00:20:53 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_session.h,v 1.104 2006/02/21 20:12:42 dmitry Exp $ */
+/* $Id: php_session.h,v 1.105 2006/03/07 00:20:53 pajoye Exp $ */
#ifndef PHP_SESSION_H
#define PHP_SESSION_H
@@ -138,9 +138,6 @@
PHP_FUNCTION(session_id);
PHP_FUNCTION(session_regenerate_id);
PHP_FUNCTION(session_decode);
-PHP_FUNCTION(session_register);
-PHP_FUNCTION(session_unregister);
-PHP_FUNCTION(session_is_registered);
PHP_FUNCTION(session_encode);
PHP_FUNCTION(session_start);
PHP_FUNCTION(session_destroy);
http://cvs.php.net/viewcvs.cgi/php-src/ext/session/session.c?r1=1.430&r2=1.431&diff_format=u
Index: php-src/ext/session/session.c
diff -u php-src/ext/session/session.c:1.430 php-src/ext/session/session.c:1.431
--- php-src/ext/session/session.c:1.430 Tue Feb 21 20:12:42 2006
+++ php-src/ext/session/session.c Tue Mar 7 00:20:53 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: session.c,v 1.430 2006/02/21 20:12:42 dmitry Exp $ */
+/* $Id: session.c,v 1.431 2006/03/07 00:20:53 pajoye Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -63,9 +63,6 @@
PHP_FE(session_id, NULL)
PHP_FE(session_regenerate_id, NULL)
PHP_FE(session_decode, NULL)
- PHP_FE(session_register, NULL)
- PHP_FE(session_unregister, NULL)
- PHP_FE(session_is_registered, NULL)
PHP_FE(session_encode, NULL)
PHP_FE(session_start, NULL)
PHP_FE(session_destroy, NULL)
@@ -281,79 +278,17 @@
zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), name, namelen + 1,
(void *) &sym_track);
+ if (sym_track == NULL) {
+ zval *empty_var;
- /*
- * Set up a proper reference between $_SESSION["x"] and $x.
- */
-
- if (PG(register_globals)) {
- zval **sym_global = NULL;
-
- zend_hash_find(&EG(symbol_table), name, namelen + 1,
- (void *) &sym_global);
-
- if (sym_global == NULL && sym_track == NULL) {
- zval *empty_var;
-
- ALLOC_INIT_ZVAL(empty_var); /* this sets refcount to 1
*/
- empty_var->refcount = 0; /* our module does not
maintain a ref */
- /* The next call will increase refcount by
NR_OF_SYM_TABLES==2 */
- zend_set_hash_symbol(empty_var, name, namelen, 1, 2,
Z_ARRVAL_P(PS(http_session_vars)), &EG(symbol_table));
- } else if (sym_global == NULL) {
- SEPARATE_ZVAL_IF_NOT_REF(sym_track);
- zend_set_hash_symbol(*sym_track, name, namelen, 1, 1,
&EG(symbol_table));
- } else if (sym_track == NULL) {
- SEPARATE_ZVAL_IF_NOT_REF(sym_global);
- zend_set_hash_symbol(*sym_global, name, namelen, 1, 1,
Z_ARRVAL_P(PS(http_session_vars)));
- }
- } else {
- if (sym_track == NULL) {
- zval *empty_var;
-
- ALLOC_INIT_ZVAL(empty_var);
-
ZEND_SET_SYMBOL_WITH_LENGTH(Z_ARRVAL_P(PS(http_session_vars)), name, namelen+1,
empty_var, 1, 0);
- }
+ ALLOC_INIT_ZVAL(empty_var);
+ ZEND_SET_SYMBOL_WITH_LENGTH(Z_ARRVAL_P(PS(http_session_vars)),
name, namelen+1, empty_var, 1, 0);
}
}
PHPAPI void php_set_session_var(char *name, size_t namelen, zval *state_val,
php_unserialize_data_t *var_hash TSRMLS_DC)
{
- if (PG(register_globals)) {
- zval **old_symbol;
- if (zend_hash_find(&EG(symbol_table),name,namelen+1,(void
*)&old_symbol) == SUCCESS) {
-
- /*
- * A global symbol with the same name exists already.
That
- * symbol might have been created by other means (e.g.
$_GET).
- *
- * hash_update in zend_set_hash_symbol is not good,
because
- * it will leave referenced variables (such as local
instances
- * of a global variable) dangling.
- *
- * BTW: if you use register_globals references between
- * session-vars won't work because of this very reason!
- */
-
-
- REPLACE_ZVAL_VALUE(old_symbol,state_val,1);
-
- /*
- * The following line will update the reference table
used for
- * unserialization. It is optional, because some
storage
- * formats may not be able to represent references.
- */
-
- if (var_hash) {
-
PHP_VAR_UNSERIALIZE_ZVAL_CHANGED(var_hash,state_val,*old_symbol);
- }
-
- zend_set_hash_symbol(*old_symbol, name, namelen, 1, 1,
Z_ARRVAL_P(PS(http_session_vars)));
- } else {
- zend_set_hash_symbol(state_val, name, namelen, 1, 2,
Z_ARRVAL_P(PS(http_session_vars)), &EG(symbol_table));
- }
- } else IF_SESSION_VARS() {
- zend_set_hash_symbol(state_val, name, namelen,
PZVAL_IS_REF(state_val), 1, Z_ARRVAL_P(PS(http_session_vars)));
- }
+ zend_set_hash_symbol(state_val, name, namelen, PZVAL_IS_REF(state_val),
1, Z_ARRVAL_P(PS(http_session_vars)));
}
PHPAPI int php_get_session_var(char *name, size_t namelen, zval ***state_var
TSRMLS_DC)
@@ -364,23 +299,6 @@
ret = zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), name,
namelen+1, (void **) state_var);
- /*
- * If register_globals is enabled, and
- * if there is an entry for the slot in $_SESSION, and
- * if that entry is still set to NULL, and
- * if the global var exists, then
- * we prefer the same key in the global sym table
- */
-
- if (PG(register_globals) && ret == SUCCESS
- && Z_TYPE_PP(*state_var) == IS_NULL) {
- zval **tmp;
-
- if (zend_hash_find(&EG(symbol_table), name, namelen + 1,
- (void **) &tmp) == SUCCESS) {
- *state_var = tmp;
- }
- }
}
return ret;
@@ -811,7 +729,7 @@
int ret = FAILURE;
IF_SESSION_VARS() {
- if (PS(bug_compat) && !PG(register_globals)) {
+ if (PS(bug_compat)) {
HashTable *ht = Z_ARRVAL_P(PS(http_session_vars));
HashPosition pos;
zval **val;
@@ -829,7 +747,7 @@
}
if (do_warn && PS(bug_compat_warn)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
"Your script possibly relies on a session side-effect which existed until PHP
4.2.3. Please be advised that the session extension does not consider global
variables as a source of data, unless register_globals is enabled. You can
disable this functionality and this warning by setting session.bug_compat_42 or
session.bug_compat_warn to off, respectively.");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,
"Your script possibly relies on a session side-effect which existed until PHP
4.2.3. Please be advised that the session extension does not consider global
variables as a source of data. You can disable this functionality and this
warning by setting session.bug_compat_42 or session.bug_compat_warn to off,
respectively.");
}
}
@@ -1562,90 +1480,6 @@
}
/* }}} */
-/* {{{ proto bool session_register(mixed var_names [, mixed ...])
- Adds varname(s) to the list of variables which are freezed at the session
end */
-PHP_FUNCTION(session_register)
-{
- zval ***args;
- int argc = ZEND_NUM_ARGS();
- int i;
-
- if (argc <= 0)
- RETURN_FALSE
- else
- args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0);
-
- if (zend_get_parameters_array_ex(argc, args) == FAILURE) {
- efree(args);
- WRONG_PARAM_COUNT;
- }
-
- if (PS(session_status) == php_session_none || PS(session_status) ==
php_session_disabled) {
- php_session_start(TSRMLS_C);
- }
-
- if (PS(session_status) == php_session_disabled) {
- efree(args);
- RETURN_FALSE;
- }
-
- for (i = 0; i < argc; i++) {
- if (Z_TYPE_PP(args[i]) == IS_ARRAY)
- SEPARATE_ZVAL(args[i]);
- php_register_var(args[i] TSRMLS_CC);
- }
-
- efree(args);
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool session_unregister(string varname)
- Removes varname from the list of variables which are freezed at the session
end */
-PHP_FUNCTION(session_unregister)
-{
- zval **p_name;
- int ac = ZEND_NUM_ARGS();
-
- if (ac != 1 || zend_get_parameters_ex(ac, &p_name) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_string_ex(p_name);
-
- PS_DEL_VARL(Z_STRVAL_PP(p_name), Z_STRLEN_PP(p_name));
-
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool session_is_registered(string varname)
- Checks if a variable is registered in session */
-PHP_FUNCTION(session_is_registered)
-{
- zval **p_name;
- zval *p_var;
- int ac = ZEND_NUM_ARGS();
-
- if (ac != 1 || zend_get_parameters_ex(ac, &p_name) == FAILURE)
- WRONG_PARAM_COUNT;
-
- convert_to_string_ex(p_name);
-
- if (PS(session_status) == php_session_none)
- RETURN_FALSE;
-
- IF_SESSION_VARS() {
- if (zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)),
- Z_STRVAL_PP(p_name),
Z_STRLEN_PP(p_name)+1,
- (void **)&p_var) == SUCCESS) {
- RETURN_TRUE;
- }
- }
- RETURN_FALSE;
-}
-/* }}} */
-
/* {{{ proto string session_encode(void)
Serializes the current setup and returns the serialized representation */
PHP_FUNCTION(session_encode)
@@ -1725,21 +1559,6 @@
IF_SESSION_VARS() {
HashTable *ht = Z_ARRVAL_P(PS(http_session_vars));
- if (PG(register_globals)) {
- uint str_len;
- zstr str;
- ulong num_key;
- HashPosition pos;
-
- zend_hash_internal_pointer_reset_ex(ht, &pos);
-
- while (zend_hash_get_current_key_ex(ht, &str, &str_len,
&num_key,
- 0, &pos) == HASH_KEY_IS_STRING)
{
- zend_delete_global_variable(str.s, str_len-1
TSRMLS_CC);
- zend_hash_move_forward_ex(ht, &pos);
- }
- }
-
/* Clean $_SESSION. */
zend_hash_clean(ht);
}
http://cvs.php.net/viewcvs.cgi/php-src/ext/session/tests/001.phpt?r1=1.12&r2=1.13&diff_format=u
Index: php-src/ext/session/tests/001.phpt
diff -u php-src/ext/session/tests/001.phpt:1.12
php-src/ext/session/tests/001.phpt:1.13
--- php-src/ext/session/tests/001.phpt:1.12 Mon Jul 4 13:09:14 2005
+++ php-src/ext/session/tests/001.phpt Tue Mar 7 00:20:53 2006
@@ -5,7 +5,6 @@
--INI--
session.use_cookies=0
session.cache_limiter=
-register_globals=1
session.serialize_handler=php
session.save_handler=files
--FILE--
@@ -23,12 +22,10 @@
$arr[3] = new foo;
$arr[3]->method();
-
-session_register("baz");
-session_register("arr");
-
-print session_encode()."\n";
-
+session_start();
+$_SESSION["baz"] = $baz;
+$_SESSION["arr"] = $arr;
+print session_encode();
session_destroy();
--EXPECT--
baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";s:4:"done";}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";s:4:"done";}}
http://cvs.php.net/viewcvs.cgi/php-src/ext/session/tests/003.phpt?r1=1.14&r2=1.15&diff_format=u
Index: php-src/ext/session/tests/003.phpt
diff -u php-src/ext/session/tests/003.phpt:1.14
php-src/ext/session/tests/003.phpt:1.15
--- php-src/ext/session/tests/003.phpt:1.14 Mon Jul 4 13:09:14 2005
+++ php-src/ext/session/tests/003.phpt Tue Mar 7 00:20:53 2006
@@ -5,7 +5,6 @@
--INI--
session.use_cookies=0
session.cache_limiter=
-register_globals=1
session.serialize_handler=php
session.save_handler=files
--FILE--
@@ -20,6 +19,8 @@
session_id("abtest");
session_start();
session_decode('baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}}');
+$baz = $_SESSION['baz'];
+$arr = $_SESSION['arr'];
$baz->method();
$arr[3]->method();
http://cvs.php.net/viewcvs.cgi/php-src/ext/session/tests/004.phpt?r1=1.16&r2=1.17&diff_format=u
Index: php-src/ext/session/tests/004.phpt
diff -u php-src/ext/session/tests/004.phpt:1.16
php-src/ext/session/tests/004.phpt:1.17
--- php-src/ext/session/tests/004.phpt:1.16 Sun Nov 30 13:57:16 2003
+++ php-src/ext/session/tests/004.phpt Tue Mar 7 00:20:53 2006
@@ -5,7 +5,6 @@
--INI--
session.use_cookies=0
session.cache_limiter=
-register_globals=1
session.name=PHPSESSID
session.serialize_handler=php
--FILE--
@@ -56,6 +55,8 @@
session_id("abtest");
session_start();
+$baz = $_SESSION['baz'];
+$arr = $_SESSION['arr'];
$baz->method();
$arr[3]->method();
@@ -72,10 +73,10 @@
session_destroy();
?>
---EXPECT--
+--EXPECTF--
OPEN: PHPSESSID
READ: abtest
-object(foo)#2 (2) {
+object(foo)#%d (2) {
["bar"]=>
string(2) "ok"
["yes"]=>
@@ -83,7 +84,7 @@
}
array(1) {
[3]=>
- object(foo)#3 (2) {
+ object(foo)#%d (2) {
["bar"]=>
string(2) "ok"
["yes"]=>
@@ -93,7 +94,7 @@
WRITE: abtest,
baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:2;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:2;}}
OPEN: PHPSESSID
READ: abtest
-object(foo)#4 (2) {
+object(foo)#%d (2) {
["bar"]=>
string(2) "ok"
["yes"]=>
@@ -101,7 +102,7 @@
}
array(1) {
[3]=>
- object(foo)#2 (2) {
+ object(foo)#%d (2) {
["bar"]=>
string(2) "ok"
["yes"]=>
http://cvs.php.net/viewcvs.cgi/php-src/ext/session/tests/005.phpt?r1=1.14&r2=1.15&diff_format=u
Index: php-src/ext/session/tests/005.phpt
diff -u php-src/ext/session/tests/005.phpt:1.14
php-src/ext/session/tests/005.phpt:1.15
--- php-src/ext/session/tests/005.phpt:1.14 Sun Nov 30 13:57:16 2003
+++ php-src/ext/session/tests/005.phpt Tue Mar 7 00:20:53 2006
@@ -5,7 +5,6 @@
--INI--
session.use_cookies=0
session.cache_limiter=
-register_globals=1
session.name=PHPSESSID
session.serialize_handler=php
--FILE--
@@ -58,6 +57,8 @@
session_id("abtest");
session_start();
+$baz = $_SESSION['baz'];
+$arr = $_SESSION['arr'];
$baz->method();
$arr[3]->method();
@@ -68,12 +69,16 @@
session_set_save_handler(array($hnd, "open"), array($hnd, "close"),
array($hnd, "read"), array($hnd, "write"), array($hnd, "destroy"), array($hnd,
"gc"));
session_start();
+$baz = $_SESSION['baz'];
+$arr = $_SESSION['arr'];
+
+
$baz->method();
$arr[3]->method();
$c = 123;
-session_register("c");
+$_SESSION['c'] = $c;
var_dump($baz); var_dump($arr); var_dump($c);
session_write_close();
@@ -84,10 +89,10 @@
session_destroy();
?>
---EXPECT--
+--EXPECTF--
OPEN: PHPSESSID
READ: abtest
-object(foo)#2 (2) {
+object(foo)#%d (2) {
["bar"]=>
string(2) "ok"
["yes"]=>
@@ -95,7 +100,7 @@
}
array(1) {
[3]=>
- object(foo)#3 (2) {
+ object(foo)#%d (2) {
["bar"]=>
string(2) "ok"
["yes"]=>
@@ -106,7 +111,7 @@
CLOSE
OPEN: PHPSESSID
READ: abtest
-object(foo)#4 (2) {
+object(foo)#%d (2) {
["bar"]=>
string(2) "ok"
["yes"]=>
@@ -114,7 +119,7 @@
}
array(1) {
[3]=>
- object(foo)#2 (2) {
+ object(foo)#%d (2) {
["bar"]=>
string(2) "ok"
["yes"]=>
@@ -126,7 +131,7 @@
CLOSE
OPEN: PHPSESSID
READ: abtest
-object(foo)#3 (2) {
+object(foo)#%d (2) {
["bar"]=>
string(2) "ok"
["yes"]=>
@@ -134,7 +139,7 @@
}
array(1) {
[3]=>
- object(foo)#4 (2) {
+ object(foo)#%d (2) {
["bar"]=>
string(2) "ok"
["yes"]=>
http://cvs.php.net/viewcvs.cgi/php-src/ext/session/tests/006.phpt?r1=1.15&r2=1.16&diff_format=u
Index: php-src/ext/session/tests/006.phpt
diff -u php-src/ext/session/tests/006.phpt:1.15
php-src/ext/session/tests/006.phpt:1.16
--- php-src/ext/session/tests/006.phpt:1.15 Wed Feb 22 12:10:02 2006
+++ php-src/ext/session/tests/006.phpt Tue Mar 7 00:20:53 2006
@@ -5,7 +5,6 @@
--INI--
session.use_cookies=0
session.cache_limiter=
-register_globals=1
session.serialize_handler=php
session.save_handler=files
--FILE--
@@ -32,15 +31,16 @@
echo "original values:\n";
var_dump($a,$b);
-session_register("a");
-session_register("b");
-session_write_close();
+$_SESSION['a'] = $a;
+$_SESSION['b'] = $b;
-session_unregister("a");
-session_unregister("b");
+session_write_close();
+unset($_SESSION['a']);
+unset($_SESSION['b']);
session_start();
-
+$a = $_SESSION['a'];
+$b = $_SESSION['b'];
echo "values after session:\n";
var_dump($a,$b);
?>
http://cvs.php.net/viewcvs.cgi/php-src/ext/session/tests/007.phpt?r1=1.9&r2=1.10&diff_format=u
Index: php-src/ext/session/tests/007.phpt
diff -u php-src/ext/session/tests/007.phpt:1.9
php-src/ext/session/tests/007.phpt:1.10
--- php-src/ext/session/tests/007.phpt:1.9 Mon Jul 4 13:09:14 2005
+++ php-src/ext/session/tests/007.phpt Tue Mar 7 00:20:53 2006
@@ -1,12 +1,11 @@
--TEST--
bug compatibility: unset($c) with enabled register_globals
--SKIPIF--
-<?php include('skipif.inc'); ?>
+<?php die('skip');/* RG removed */ ?>
--INI--
register_long_arrays=1
session.use_cookies=0
session.cache_limiter=
-register_globals=1
session.bug_compat_42=1
session.serialize_handler=php
session.save_handler=files
@@ -22,7 +21,8 @@
### Phase 2 $HTTP_SESSION_VARS["c"] does not contain any value
session_id("abtest");
-session_register("c");
+$_SESSION['c'] = $c;
+
unset($c);
$c = 3.14;
session_write_close();
@@ -31,6 +31,7 @@
### Phase 3 $HTTP_SESSION_VARS["c"] is set
session_start();
+$c = $_SESSION['c'];
var_dump($c);
var_dump($HTTP_SESSION_VARS);
unset($c);
@@ -43,6 +44,7 @@
### Phase 4 final
session_start();
+$c = $_SESSION['c'];
var_dump($c);
var_dump($HTTP_SESSION_VARS);
http://cvs.php.net/viewcvs.cgi/php-src/ext/session/tests/008-php4.2.3.phpt?r1=1.7&r2=1.8&diff_format=u
Index: php-src/ext/session/tests/008-php4.2.3.phpt
diff -u php-src/ext/session/tests/008-php4.2.3.phpt:1.7
php-src/ext/session/tests/008-php4.2.3.phpt:1.8
--- php-src/ext/session/tests/008-php4.2.3.phpt:1.7 Mon Jul 4 13:09:14 2005
+++ php-src/ext/session/tests/008-php4.2.3.phpt Tue Mar 7 00:20:53 2006
@@ -2,13 +2,13 @@
bug compatibility: global is used albeit register_globals=0
--SKIPIF--
<?php include('skipif.inc');
+die("skip, no more RG and session_register");
if (version_compare(PHP_VERSION,"4.2.3-dev", "<")) die("skip this is for PHP
>= 4.2.3");
?>
--INI--
register_long_arrays=1
session.use_cookies=0
session.cache_limiter=
-register_globals=0
session.bug_compat_42=1
session.bug_compat_warn=1
track_errors=1
@@ -21,14 +21,14 @@
--FILE--
<?php
session_id("abtest");
-
### Phase 1 cleanup
session_start();
session_destroy();
### Phase 2 $HTTP_SESSION_VARS["c"] does not contain any value
session_id("abtest");
-session_register("c");
+$_SESSION['c'] = NULL;
+$c = $_SESSION['c'];
var_dump($c);
unset($c);
$c = 3.14;
@@ -40,6 +40,7 @@
### Phase 3 $HTTP_SESSION_VARS["c"] is set
session_start();
+$c = $_SESSION['c'];
var_dump($HTTP_SESSION_VARS);
unset($c);
$c = 2.78;
@@ -51,6 +52,7 @@
### Phase 4 final
session_start();
+$c = $_SESSION['c'];
var_dump($c);
var_dump($HTTP_SESSION_VARS);
http://cvs.php.net/viewcvs.cgi/php-src/ext/session/tests/008.phpt?r1=1.7&r2=1.8&diff_format=u
Index: php-src/ext/session/tests/008.phpt
diff -u php-src/ext/session/tests/008.phpt:1.7
php-src/ext/session/tests/008.phpt:1.8
--- php-src/ext/session/tests/008.phpt:1.7 Thu Oct 24 18:18:44 2002
+++ php-src/ext/session/tests/008.phpt Tue Mar 7 00:20:53 2006
@@ -7,7 +7,6 @@
--INI--
session.use_cookies=0
session.cache_limiter=
-register_globals=0
session.bug_compat_42=1
session.bug_compat_warn=0
--FILE--
http://cvs.php.net/viewcvs.cgi/php-src/ext/session/tests/009.phpt?r1=1.5&r2=1.6&diff_format=u
Index: php-src/ext/session/tests/009.phpt
diff -u php-src/ext/session/tests/009.phpt:1.5
php-src/ext/session/tests/009.phpt:1.6
--- php-src/ext/session/tests/009.phpt:1.5 Mon Jul 4 13:09:14 2005
+++ php-src/ext/session/tests/009.phpt Tue Mar 7 00:20:53 2006
@@ -6,7 +6,6 @@
register_long_arrays=1
session.use_cookies=0
session.cache_limiter=
-register_globals=0
session.bug_compat_42=1
session.bug_compat_warn=0
session.serialize_handler=php
http://cvs.php.net/viewcvs.cgi/php-src/ext/session/tests/010.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/session/tests/010.phpt
diff -u php-src/ext/session/tests/010.phpt:1.2
php-src/ext/session/tests/010.phpt:1.3
--- php-src/ext/session/tests/010.phpt:1.2 Thu Oct 3 16:14:55 2002
+++ php-src/ext/session/tests/010.phpt Tue Mar 7 00:20:53 2006
@@ -5,7 +5,6 @@
--INI--
session.use_cookies=0
session.cache_limiter=
-register_globals=0
session.bug_compat_42=1
session.bug_compat_warn=0
--FILE--
http://cvs.php.net/viewcvs.cgi/php-src/ext/session/tests/011.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/session/tests/011.phpt
diff -u php-src/ext/session/tests/011.phpt:1.2
php-src/ext/session/tests/011.phpt:1.3
--- php-src/ext/session/tests/011.phpt:1.2 Thu Oct 3 16:14:55 2002
+++ php-src/ext/session/tests/011.phpt Tue Mar 7 00:20:53 2006
@@ -5,7 +5,6 @@
--INI--
session.use_cookies=0
session.cache_limiter=
-register_globals=0
session.bug_compat_42=1
session.bug_compat_warn=0
--FILE--
http://cvs.php.net/viewcvs.cgi/php-src/ext/session/tests/012.phpt?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/session/tests/012.phpt
diff -u php-src/ext/session/tests/012.phpt:1.4
php-src/ext/session/tests/012.phpt:1.5
--- php-src/ext/session/tests/012.phpt:1.4 Mon Jul 4 13:09:14 2005
+++ php-src/ext/session/tests/012.phpt Tue Mar 7 00:20:53 2006
@@ -1,11 +1,10 @@
--TEST--
registering $_SESSION should not segfault
--SKIPIF--
-<?php include('skipif.inc'); ?>
+<?php die("skip no more RG or session_register"); ?>
--INI--
session.use_cookies=0
session.cache_limiter=
-register_globals=1
session.bug_compat_42=1
session.bug_compat_warn=0
session.serialize_handler=php
http://cvs.php.net/viewcvs.cgi/php-src/ext/session/tests/013.phpt?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/session/tests/013.phpt
diff -u php-src/ext/session/tests/013.phpt:1.4
php-src/ext/session/tests/013.phpt:1.5
--- php-src/ext/session/tests/013.phpt:1.4 Mon Jul 4 13:09:14 2005
+++ php-src/ext/session/tests/013.phpt Tue Mar 7 00:20:53 2006
@@ -5,7 +5,6 @@
--INI--
session.use_cookies=0
session.cache_limiter=
-register_globals=1
session.bug_compat_42=1
session.bug_compat_warn=0
session.serialize_handler=php
http://cvs.php.net/viewcvs.cgi/php-src/ext/session/tests/014.phpt?r1=1.7&r2=1.8&diff_format=u
Index: php-src/ext/session/tests/014.phpt
diff -u php-src/ext/session/tests/014.phpt:1.7
php-src/ext/session/tests/014.phpt:1.8
--- php-src/ext/session/tests/014.phpt:1.7 Mon Jul 4 13:09:14 2005
+++ php-src/ext/session/tests/014.phpt Tue Mar 7 00:20:53 2006
@@ -6,7 +6,6 @@
session.use_trans_sid=1
session.use_cookies=0
session.cache_limiter=
-register_globals=1
session.bug_compat_42=1
session.bug_compat_warn=0
session.name=PHPSESSID
http://cvs.php.net/viewcvs.cgi/php-src/ext/session/tests/019.phpt?r1=1.10&r2=1.11&diff_format=u
Index: php-src/ext/session/tests/019.phpt
diff -u php-src/ext/session/tests/019.phpt:1.10
php-src/ext/session/tests/019.phpt:1.11
--- php-src/ext/session/tests/019.phpt:1.10 Mon Jul 4 13:09:14 2005
+++ php-src/ext/session/tests/019.phpt Tue Mar 7 00:20:53 2006
@@ -1,11 +1,10 @@
--TEST--
serializing references test case using globals
--SKIPIF--
-<?php include('skipif.inc'); ?>
+<?php die("skip no more RG or session_register");include('skipif.inc'); ?>
--INI--
session.use_cookies=0
session.cache_limiter=
-register_globals=1
session.serialize_handler=php
session.save_handler=files
--FILE--
@@ -25,7 +24,8 @@
session_id("abtest");
session_start();
-session_register('o1', 'o2' );
+$_SESSION['o1'] = $o1;
+$_SESSION['o2'] = $o2;
$o1 = new TFoo(42);
$o2 =& $o1;
http://cvs.php.net/viewcvs.cgi/php-src/ext/session/tests/bug24592.phpt?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/session/tests/bug24592.phpt
diff -u php-src/ext/session/tests/bug24592.phpt:1.4
php-src/ext/session/tests/bug24592.phpt:1.5
--- php-src/ext/session/tests/bug24592.phpt:1.4 Wed Feb 22 12:11:49 2006
+++ php-src/ext/session/tests/bug24592.phpt Tue Mar 7 00:20:53 2006
@@ -3,7 +3,6 @@
--SKIPIF--
<?php include('skipif.inc'); ?>
--INI--
-register_globals=0
html_errors=0
session.save_handler=files
--FILE--
http://cvs.php.net/viewcvs.cgi/php-src/ext/session/tests/bug26862.phpt?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/session/tests/bug26862.phpt
diff -u php-src/ext/session/tests/bug26862.phpt:1.3
php-src/ext/session/tests/bug26862.phpt:1.4
--- php-src/ext/session/tests/bug26862.phpt:1.3 Mon Jul 4 13:09:14 2005
+++ php-src/ext/session/tests/bug26862.phpt Tue Mar 7 00:20:53 2006
@@ -3,7 +3,6 @@
--SKIPIF--
<?php include('skipif.inc'); ?>
--INI--
-register_globals=0
html_errors=0
session.use_trans_sid=0
session.save_handler=files
http://cvs.php.net/viewcvs.cgi/php-src/main/main.c?r1=1.667&r2=1.668&diff_format=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.667 php-src/main/main.c:1.668
--- php-src/main/main.c:1.667 Thu Mar 2 13:12:45 2006
+++ php-src/main/main.c Tue Mar 7 00:20:53 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: main.c,v 1.667 2006/03/02 13:12:45 dmitry Exp $ */
+/* $Id: main.c,v 1.668 2006/03/07 00:20:53 pajoye Exp $ */
/* {{{ includes
*/
@@ -381,7 +381,6 @@
STD_PHP_INI_ENTRY("output_buffering", "0",
PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateLong, output_buffering,
php_core_globals, core_globals)
STD_PHP_INI_ENTRY("output_handler", NULL,
PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateString, output_handler,
php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("register_argc_argv", "1",
PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, register_argc_argv,
php_core_globals, core_globals)
- STD_PHP_INI_BOOLEAN("register_globals", "0",
PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, register_globals,
php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("register_long_arrays", "1",
PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, register_long_arrays,
php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("auto_globals_jit", "1",
PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, auto_globals_jit,
php_core_globals, core_globals)
#if PHP_SAFE_MODE
http://cvs.php.net/viewcvs.cgi/php-src/main/php_globals.h?r1=1.100&r2=1.101&diff_format=u
Index: php-src/main/php_globals.h
diff -u php-src/main/php_globals.h:1.100 php-src/main/php_globals.h:1.101
--- php-src/main/php_globals.h:1.100 Sun Jan 1 13:09:57 2006
+++ php-src/main/php_globals.h Tue Mar 7 00:20:54 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_globals.h,v 1.100 2006/01/01 13:09:57 sniper Exp $ */
+/* $Id: php_globals.h,v 1.101 2006/03/07 00:20:54 pajoye Exp $ */
#ifndef PHP_GLOBALS_H
#define PHP_GLOBALS_H
@@ -118,7 +118,6 @@
zend_bool expose_php;
- zend_bool register_globals;
zend_bool register_long_arrays;
zend_bool register_argc_argv;
zend_bool auto_globals_jit;
http://cvs.php.net/viewcvs.cgi/php-src/main/php_variables.c?r1=1.117&r2=1.118&diff_format=u
Index: php-src/main/php_variables.c
diff -u php-src/main/php_variables.c:1.117 php-src/main/php_variables.c:1.118
--- php-src/main/php_variables.c:1.117 Thu Mar 2 13:12:45 2006
+++ php-src/main/php_variables.c Tue Mar 7 00:20:54 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_variables.c,v 1.117 2006/03/02 13:12:45 dmitry Exp $ */
+/* $Id: php_variables.c,v 1.118 2006/03/07 00:20:54 pajoye Exp $ */
#include <stdio.h>
#include "php.h"
@@ -90,9 +90,8 @@
if (track_vars_array) {
symtable1 = Z_ARRVAL_P(track_vars_array);
- } else if (PG(register_globals)) {
- symtable1 = EG(active_symbol_table);
}
+
if (!symtable1) {
/* Nothing to do */
zval_dtor(val);
@@ -253,9 +252,8 @@
if (track_vars_array) {
symtable1 = Z_ARRVAL_P(track_vars_array);
- } else if (PG(register_globals)) {
- symtable1 = EG(active_symbol_table);
}
+
if (!symtable1) {
/* Nothing to do */
zval_dtor(val);
@@ -669,8 +667,7 @@
int count = 0;
char *ss, *space;
- if (! (PG(register_globals) || SG(request_info).argc ||
- PG(http_globals)[TRACK_VARS_SERVER]) ) {
+ if (! (SG(request_info).argc || PG(http_globals)[TRACK_VARS_SERVER]) ) {
return;
}
@@ -727,7 +724,7 @@
argc->is_ref = 0;
argc->refcount = 0;
- if (PG(register_globals) || SG(request_info).argc) {
+ if (SG(request_info).argc) {
arr->refcount++;
argc->refcount++;
zend_hash_update(&EG(symbol_table), "argv", sizeof("argv"),
&arr, sizeof(zval *), NULL);
@@ -812,7 +809,6 @@
ulong num_key;
HashPosition pos;
int key_type;
- int globals_check = (PG(register_globals) && (dest ==
(&EG(symbol_table))));
zend_hash_internal_pointer_reset_ex(src, &pos);
while (zend_hash_get_current_data_ex(src, (void **)&src_entry, &pos) ==
SUCCESS) {
@@ -826,7 +822,7 @@
(*src_entry)->refcount++;
if (key_type == HASH_KEY_IS_STRING) {
/* if register_globals is on and working with
main symbol table, prevent overwriting of GLOBALS */
- if (!globals_check || string_key_len !=
sizeof("GLOBALS") || memcmp(string_key.s, "GLOBALS", sizeof("GLOBALS") - 1)) {
+ if (string_key_len != sizeof("GLOBALS") ||
memcmp(string_key.s, "GLOBALS", sizeof("GLOBALS") - 1)) {
zend_u_hash_update(dest, key_type,
string_key, string_key_len, src_entry, sizeof(zval *), NULL);
} else {
(*src_entry)->refcount--;
@@ -855,7 +851,7 @@
unsigned char _gpc_flags[5] = {0, 0, 0, 0, 0};
zval *dummy_track_vars_array = NULL;
zend_bool initialized_dummy_track_vars_array=0;
- zend_bool jit_initialization = (PG(auto_globals_jit) &&
!PG(register_globals) && !PG(register_long_arrays) && !PG(register_argc_argv));
+ zend_bool jit_initialization = (PG(auto_globals_jit) &&
!PG(register_long_arrays) && !PG(register_argc_argv));
struct auto_global_record {
char *name;
uint name_len;
@@ -885,9 +881,6 @@
if (!_gpc_flags[0] && !SG(headers_sent) &&
SG(request_info).request_method && !strcasecmp(SG(request_info).request_method,
"POST")) {
sapi_module.treat_data(PARSE_POST,
NULL, NULL TSRMLS_CC); /* POST Data */
_gpc_flags[0] = 1;
- if (PG(register_globals)) {
-
php_autoglobal_merge(&EG(symbol_table),
Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_POST]) TSRMLS_CC);
- }
}
break;
case 'c':
@@ -895,9 +888,6 @@
if (!_gpc_flags[1]) {
sapi_module.treat_data(PARSE_COOKIE,
NULL, NULL TSRMLS_CC); /* Cookie Data */
_gpc_flags[1] = 1;
- if (PG(register_globals)) {
-
php_autoglobal_merge(&EG(symbol_table),
Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]) TSRMLS_CC);
- }
}
break;
case 'g':
@@ -905,9 +895,6 @@
if (!_gpc_flags[2]) {
sapi_module.treat_data(PARSE_GET, NULL,
NULL TSRMLS_CC); /* GET Data */
_gpc_flags[2] = 1;
- if (PG(register_globals)) {
-
php_autoglobal_merge(&EG(symbol_table),
Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_GET]) TSRMLS_CC);
- }
}
break;
case 'e':
@@ -916,9 +903,6 @@
zend_auto_global_disable_jit("_ENV",
sizeof("_ENV")-1 TSRMLS_CC);
php_auto_globals_create_env("_ENV",
sizeof("_ENV")-1 TSRMLS_CC);
_gpc_flags[3] = 1;
- if (PG(register_globals)) {
-
php_autoglobal_merge(&EG(symbol_table),
Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_ENV]) TSRMLS_CC);
- }
}
break;
case 's':
@@ -927,9 +911,6 @@
zend_auto_global_disable_jit("_SERVER",
sizeof("_SERVER")-1 TSRMLS_CC);
php_register_server_variables(TSRMLS_C);
_gpc_flags[4] = 1;
- if (PG(register_globals)) {
-
php_autoglobal_merge(&EG(symbol_table),
Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]) TSRMLS_CC);
- }
}
break;
}
http://cvs.php.net/viewcvs.cgi/php-src/main/rfc1867.c?r1=1.183&r2=1.184&diff_format=u
Index: php-src/main/rfc1867.c
diff -u php-src/main/rfc1867.c:1.183 php-src/main/rfc1867.c:1.184
--- php-src/main/rfc1867.c:1.183 Thu Mar 2 13:12:45 2006
+++ php-src/main/rfc1867.c Tue Mar 7 00:20:54 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: rfc1867.c,v 1.183 2006/03/02 13:12:45 dmitry Exp $ */
+/* $Id: rfc1867.c,v 1.184 2006/03/07 00:20:54 pajoye Exp $ */
/*
* This product includes software developed by the Apache Group
@@ -316,41 +316,25 @@
static void register_http_post_files_variable(char *strvar, char *val, zval
*http_post_files, zend_bool override_protection TSRMLS_DC)
{
- int register_globals = PG(register_globals);
-
- PG(register_globals) = 0;
safe_php_register_variable(strvar, val, http_post_files,
override_protection TSRMLS_CC);
- PG(register_globals) = register_globals;
}
static void register_u_http_post_files_variable(UChar *strvar, UChar *val, int
val_len, zval *http_post_files, zend_bool override_protection TSRMLS_DC)
{
- int register_globals = PG(register_globals);
-
- PG(register_globals) = 0;
safe_u_php_register_variable(strvar, val, val_len, http_post_files,
override_protection TSRMLS_CC);
- PG(register_globals) = register_globals;
}
static void register_http_post_files_variable_ex(char *var, zval *val, zval
*http_post_files, zend_bool override_protection TSRMLS_DC)
{
- int register_globals = PG(register_globals);
-
- PG(register_globals) = 0;
safe_php_register_variable_ex(var, val, http_post_files,
override_protection TSRMLS_CC);
- PG(register_globals) = register_globals;
}
static void register_u_http_post_files_variable_ex(UChar *var, zval *val, zval
*http_post_files, zend_bool override_protection TSRMLS_DC)
{
- int register_globals = PG(register_globals);
-
- PG(register_globals) = 0;
safe_u_php_register_variable_ex(var, val, http_post_files,
override_protection TSRMLS_CC);
- PG(register_globals) = register_globals;
}
http://cvs.php.net/viewcvs.cgi/php-src/sapi/apache/mod_php5.c?r1=1.28&r2=1.29&diff_format=u
Index: php-src/sapi/apache/mod_php5.c
diff -u php-src/sapi/apache/mod_php5.c:1.28 php-src/sapi/apache/mod_php5.c:1.29
--- php-src/sapi/apache/mod_php5.c:1.28 Wed Mar 1 16:27:47 2006
+++ php-src/sapi/apache/mod_php5.c Tue Mar 7 00:20:54 2006
@@ -17,7 +17,7 @@
| PHP 4.0 patches by Zeev Suraski <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: mod_php5.c,v 1.28 2006/03/01 16:27:47 dmitry Exp $ */
+/* $Id: mod_php5.c,v 1.29 2006/03/07 00:20:54 pajoye Exp $ */
#include "php_apache_http.h"
#include "http_conf_globals.h"
@@ -262,9 +262,6 @@
/* If PATH_TRANSLATED doesn't exist, copy it from SCRIPT_FILENAME */
if (track_vars_array) {
symbol_table = track_vars_array->value.ht;
- } else if (PG(register_globals)) {
- /* should never happen nowadays */
- symbol_table = EG(active_symbol_table);
} else {
symbol_table = NULL;
}
http://cvs.php.net/viewcvs.cgi/php-src/sapi/apache_hooks/mod_php5.c?r1=1.15&r2=1.16&diff_format=u
Index: php-src/sapi/apache_hooks/mod_php5.c
diff -u php-src/sapi/apache_hooks/mod_php5.c:1.15
php-src/sapi/apache_hooks/mod_php5.c:1.16
--- php-src/sapi/apache_hooks/mod_php5.c:1.15 Wed Mar 1 16:27:47 2006
+++ php-src/sapi/apache_hooks/mod_php5.c Tue Mar 7 00:20:54 2006
@@ -17,7 +17,7 @@
| PHP 4.0 patches by Zeev Suraski <[EMAIL PROTECTED]>
|
+----------------------------------------------------------------------+
*/
-/* $Id: mod_php5.c,v 1.15 2006/03/01 16:27:47 dmitry Exp $ */
+/* $Id: mod_php5.c,v 1.16 2006/03/07 00:20:54 pajoye Exp $ */
#include "php_apache_http.h"
@@ -384,9 +384,6 @@
/* If PATH_TRANSLATED doesn't exist, copy it from SCRIPT_FILENAME */
if (track_vars_array) {
symbol_table = track_vars_array->value.ht;
- } else if (PG(register_globals)) {
- /* should never happen nowadays */
- symbol_table = EG(active_symbol_table);
} else {
symbol_table = NULL;
}
http://cvs.php.net/viewcvs.cgi/php-src/sapi/apache_hooks/sapi_apache.c?r1=1.10&r2=1.11&diff_format=u
Index: php-src/sapi/apache_hooks/sapi_apache.c
diff -u php-src/sapi/apache_hooks/sapi_apache.c:1.10
php-src/sapi/apache_hooks/sapi_apache.c:1.11
--- php-src/sapi/apache_hooks/sapi_apache.c:1.10 Sun Jan 1 13:09:57 2006
+++ php-src/sapi/apache_hooks/sapi_apache.c Tue Mar 7 00:20:54 2006
@@ -19,7 +19,7 @@
| Stig Bakken <[EMAIL PROTECTED]>
|
+----------------------------------------------------------------------+
*/
-/* $Id: sapi_apache.c,v 1.10 2006/01/01 13:09:57 sniper Exp $ */
+/* $Id: sapi_apache.c,v 1.11 2006/03/07 00:20:54 pajoye Exp $ */
#include "php_apache_http.h"
@@ -79,12 +79,8 @@
}
req = php_apache_request_new(r);
- if(PG(register_globals)) {
- php_register_variable_ex("request", req, NULL TSRMLS_CC);
- }
- else {
- php_register_variable_ex("request", req,
PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC);
- }
+ php_register_variable_ex("request", req,
PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC);
+
switch(handler->type) {
case AP_HANDLER_TYPE_FILE:
php_register_variable("PHP_SELF_HOOK", handler->name,
PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php