kalle Thu, 15 Apr 2010 16:36:08 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=298048
Log: Removed register_long_arrays ini option (and $HTTP_SESSION_VARS from ext/session) Changed paths: U php/php-src/trunk/NEWS U php/php-src/trunk/Zend/tests/unset_cv05.phpt U php/php-src/trunk/ext/filter/filter.c U php/php-src/trunk/ext/session/session.c U php/php-src/trunk/ext/session/tests/007.phpt U php/php-src/trunk/ext/session/tests/008-php4.2.3.phpt U php/php-src/trunk/ext/session/tests/009.phpt U php/php-src/trunk/main/main.c U php/php-src/trunk/main/php_globals.h U php/php-src/trunk/main/php_variables.c U php/php-src/trunk/php.ini-development U php/php-src/trunk/php.ini-production
Modified: php/php-src/trunk/NEWS =================================================================== --- php/php-src/trunk/NEWS 2010-04-15 16:20:13 UTC (rev 298047) +++ php/php-src/trunk/NEWS 2010-04-15 16:36:08 UTC (rev 298048) @@ -19,6 +19,7 @@ - Removed legacy features: (Kalle) . define_syslog_variables ini option and its associated function. + . register_long_arrays ini option. . y2k_compliance ini option. ?? ??? 20??, PHP 5.3.3 Modified: php/php-src/trunk/Zend/tests/unset_cv05.phpt =================================================================== --- php/php-src/trunk/Zend/tests/unset_cv05.phpt 2010-04-15 16:20:13 UTC (rev 298047) +++ php/php-src/trunk/Zend/tests/unset_cv05.phpt 2010-04-15 16:36:08 UTC (rev 298048) @@ -1,7 +1,6 @@ --TEST-- unset() CV 5 (indirect unset() of global variable in session_start()) --INI-- -register_long_arrays=1 session.auto_start=0 session.save_handler=files --SKIPIF-- @@ -12,14 +11,13 @@ ?> --FILE-- <?php -$HTTP_SESSION_VARS = "ok\n"; -echo $HTTP_SESSION_VARS; +$_SESSION = "ok\n"; +echo $_SESSION; session_start(); -echo $HTTP_SESSION_VARS; +echo $_SESSION; echo "\nok\n"; ?> --EXPECTF-- -Warning: Directive 'register_long_arrays' is deprecated in PHP %d.%d and greater in Unknown on line 0 ok Warning: session_start(): Cannot send session cookie - headers already sent by (output started at %sunset_cv05.php on line %d Modified: php/php-src/trunk/ext/filter/filter.c =================================================================== --- php/php-src/trunk/ext/filter/filter.c 2010-04-15 16:20:13 UTC (rev 298047) +++ php/php-src/trunk/ext/filter/filter.c 2010-04-15 16:36:08 UTC (rev 298048) @@ -537,7 +537,7 @@ { zval *array_ptr = NULL; - zend_bool jit_initialization = (PG(auto_globals_jit) && !PG(register_globals) && !PG(register_long_arrays)); + zend_bool jit_initialization = (PG(auto_globals_jit) && !PG(register_globals)); switch (arg) { case PARSE_GET: Modified: php/php-src/trunk/ext/session/session.c =================================================================== --- php/php-src/trunk/ext/session/session.c 2010-04-15 16:20:13 UTC (rev 298047) +++ php/php-src/trunk/ext/session/session.c 2010-04-15 16:36:08 UTC (rev 298048) @@ -235,8 +235,7 @@ { zval *session_vars = NULL; - /* Unconditionally destroy existing arrays -- possible dirty data */ - zend_delete_global_variable("HTTP_SESSION_VARS", sizeof("HTTP_SESSION_VARS")-1 TSRMLS_CC); + /* Unconditionally destroy existing array -- possible dirty data */ zend_delete_global_variable("_SESSION", sizeof("_SESSION")-1 TSRMLS_CC); if (PS(http_session_vars)) { @@ -247,13 +246,7 @@ array_init(session_vars); PS(http_session_vars) = session_vars; - if (PG(register_long_arrays)) { - ZEND_SET_GLOBAL_VAR_WITH_LENGTH("HTTP_SESSION_VARS", sizeof("HTTP_SESSION_VARS"), PS(http_session_vars), 3, 1); - ZEND_SET_GLOBAL_VAR_WITH_LENGTH("_SESSION", sizeof("_SESSION"), PS(http_session_vars), 3, 1); - } - else { - ZEND_SET_GLOBAL_VAR_WITH_LENGTH("_SESSION", sizeof("_SESSION"), PS(http_session_vars), 2, 1); - } + ZEND_SET_GLOBAL_VAR_WITH_LENGTH("_SESSION", sizeof("_SESSION"), PS(http_session_vars), 2, 1); } /* }}} */ @@ -1814,9 +1807,7 @@ } else { convert_to_string_ex(entry); - if ((strcmp(Z_STRVAL_PP(entry), "HTTP_SESSION_VARS") != 0) && - (strcmp(Z_STRVAL_PP(entry), "_SESSION") != 0) - ) { + if (strcmp(Z_STRVAL_PP(entry), "_SESSION") != 0) { PS_ADD_VARL(Z_STRVAL_PP(entry), Z_STRLEN_PP(entry)); } } Modified: php/php-src/trunk/ext/session/tests/007.phpt =================================================================== --- php/php-src/trunk/ext/session/tests/007.phpt 2010-04-15 16:20:13 UTC (rev 298047) +++ php/php-src/trunk/ext/session/tests/007.phpt 2010-04-15 16:36:08 UTC (rev 298048) @@ -3,7 +3,6 @@ --SKIPIF-- <?php include('skipif.inc'); ?> --INI-- -register_long_arrays=1 session.use_cookies=0 session.cache_limiter= register_globals=1 @@ -21,39 +20,37 @@ session_start(); session_destroy(); -### Phase 2 $HTTP_SESSION_VARS["c"] does not contain any value +### Phase 2 $_SESSION["c"] does not contain any value session_id("abtest"); session_register("c"); unset($c); $c = 3.14; session_write_close(); -unset($HTTP_SESSION_VARS); +unset($_SESSION); unset($c); -### Phase 3 $HTTP_SESSION_VARS["c"] is set +### Phase 3 $_SESSION["c"] is set session_start(); var_dump($c); -var_dump($HTTP_SESSION_VARS); +var_dump($_SESSION); unset($c); $c = 2.78; session_write_close(); -unset($HTTP_SESSION_VARS); +unset($_SESSION); unset($c); ### Phase 4 final session_start(); var_dump($c); -var_dump($HTTP_SESSION_VARS); +var_dump($_SESSION); session_destroy(); ?> --EXPECTF-- Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0 -Warning: Directive 'register_long_arrays' is deprecated in PHP 5.3 and greater in Unknown on line 0 - Deprecated: Function session_register() is deprecated in %s on line %d float(3.14) array(1) { Modified: php/php-src/trunk/ext/session/tests/008-php4.2.3.phpt =================================================================== --- php/php-src/trunk/ext/session/tests/008-php4.2.3.phpt 2010-04-15 16:20:13 UTC (rev 298047) +++ php/php-src/trunk/ext/session/tests/008-php4.2.3.phpt 2010-04-15 16:36:08 UTC (rev 298048) @@ -5,7 +5,6 @@ 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 @@ -27,7 +26,7 @@ session_start(); session_destroy(); -### Phase 2 $HTTP_SESSION_VARS["c"] does not contain any value +### Phase 2 $_SESSION["c"] does not contain any value session_id("abtest"); session_register("c"); var_dump($c); @@ -36,29 +35,28 @@ @session_write_close(); // this generates an E_WARNING which will be printed // by $php_errormsg so we can use "@" here. ANY further message IS an error. echo $php_errormsg."\n"; -unset($HTTP_SESSION_VARS); +unset($_SESSION); unset($c); -### Phase 3 $HTTP_SESSION_VARS["c"] is set +### Phase 3 $_SESSION["c"] is set session_start(); -var_dump($HTTP_SESSION_VARS); +var_dump($_SESSION); unset($c); $c = 2.78; session_write_close(); -unset($HTTP_SESSION_VARS); +unset($_SESSION); unset($c); ### Phase 4 final session_start(); var_dump($c); -var_dump($HTTP_SESSION_VARS); +var_dump($_SESSION); session_destroy(); ?> --EXPECTF-- -Warning: Directive 'register_long_arrays' is deprecated in PHP 5.3 and greater in Unknown on line 0 NULL session_write_close(): 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 array(1) { Modified: php/php-src/trunk/ext/session/tests/009.phpt =================================================================== --- php/php-src/trunk/ext/session/tests/009.phpt 2010-04-15 16:20:13 UTC (rev 298047) +++ php/php-src/trunk/ext/session/tests/009.phpt 2010-04-15 16:36:08 UTC (rev 298048) @@ -3,7 +3,6 @@ --SKIPIF-- <?php include('skipif.inc'); ?> --INI-- -register_long_arrays=1 session.use_cookies=0 session.cache_limiter= register_globals=0 @@ -21,29 +20,28 @@ session_start(); session_destroy(); -### Phase 2 $HTTP_SESSION_VARS["c"] does not contain any value +### Phase 2 $_SESSION["c"] does not contain any value session_id("abtest"); session_start(); -var_dump($HTTP_SESSION_VARS); -$HTTP_SESSION_VARS["name"] = "foo"; -var_dump($HTTP_SESSION_VARS); +var_dump($_SESSION); +$_SESSION["name"] = "foo"; +var_dump($_SESSION); session_write_close(); -### Phase 3 $HTTP_SESSION_VARS["c"] is set +### Phase 3 $_SESSION["c"] is set session_start(); -var_dump($HTTP_SESSION_VARS); -unset($HTTP_SESSION_VARS["name"]); -var_dump($HTTP_SESSION_VARS); +var_dump($_SESSION); +unset($_SESSION["name"]); +var_dump($_SESSION); session_write_close(); ### Phase 4 final session_start(); -var_dump($HTTP_SESSION_VARS); +var_dump($_SESSION); session_destroy(); ?> --EXPECT-- -Warning: Directive 'register_long_arrays' is deprecated in PHP 5.3 and greater in Unknown on line 0 array(0) { } array(1) { Modified: php/php-src/trunk/main/main.c =================================================================== --- php/php-src/trunk/main/main.c 2010-04-15 16:20:13 UTC (rev 298047) +++ php/php-src/trunk/main/main.c 2010-04-15 16:36:08 UTC (rev 298048) @@ -459,7 +459,6 @@ 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 STD_PHP_INI_BOOLEAN("safe_mode", "1", PHP_INI_SYSTEM, OnUpdateBool, safe_mode, php_core_globals, core_globals) @@ -2056,14 +2055,13 @@ struct { const long error_level; const char *phrase; - const char *directives[7]; /* Remember to change this if the number of directives change */ + const char *directives[6]; /* Remember to change this if the number of directives change */ } directives[] = { { E_CORE_WARNING, "Directive '%s' is deprecated in PHP 5.3 and greater", { "register_globals", - "register_long_arrays", "safe_mode", "magic_quotes_gpc", "magic_quotes_runtime", @@ -2076,6 +2074,7 @@ "Directive '%s' is no longer available in PHP", { "define_syslog_variables", + "register_long_arrays", "zend.ze1_compatibility_mode", NULL } Modified: php/php-src/trunk/main/php_globals.h =================================================================== --- php/php-src/trunk/main/php_globals.h 2010-04-15 16:20:13 UTC (rev 298047) +++ php/php-src/trunk/main/php_globals.h 2010-04-15 16:36:08 UTC (rev 298048) @@ -123,7 +123,6 @@ zend_bool expose_php; zend_bool register_globals; - zend_bool register_long_arrays; zend_bool register_argc_argv; zend_bool auto_globals_jit; Modified: php/php-src/trunk/main/php_variables.c =================================================================== --- php/php-src/trunk/main/php_variables.c 2010-04-15 16:20:13 UTC (rev 298047) +++ php/php-src/trunk/main/php_variables.c 2010-04-15 16:36:08 UTC (rev 298048) @@ -653,20 +653,18 @@ { char *p; unsigned char _gpc_flags[5] = {0, 0, 0, 0, 0}; - zend_bool jit_initialization = (PG(auto_globals_jit) && !PG(register_globals) && !PG(register_long_arrays)); + zend_bool jit_initialization = (PG(auto_globals_jit) && !PG(register_globals)); struct auto_global_record { char *name; uint name_len; - char *long_name; - uint long_name_len; zend_bool jit_initialization; } auto_global_records[] = { - { "_POST", sizeof("_POST"), "HTTP_POST_VARS", sizeof("HTTP_POST_VARS"), 0 }, - { "_GET", sizeof("_GET"), "HTTP_GET_VARS", sizeof("HTTP_GET_VARS"), 0 }, - { "_COOKIE", sizeof("_COOKIE"), "HTTP_COOKIE_VARS", sizeof("HTTP_COOKIE_VARS"), 0 }, - { "_SERVER", sizeof("_SERVER"), "HTTP_SERVER_VARS", sizeof("HTTP_SERVER_VARS"), 1 }, - { "_ENV", sizeof("_ENV"), "HTTP_ENV_VARS", sizeof("HTTP_ENV_VARS"), 1 }, - { "_FILES", sizeof("_FILES"), "HTTP_POST_FILES", sizeof("HTTP_POST_FILES"), 0 }, + { "_POST", sizeof("_POST"), 0 }, + { "_GET", sizeof("_GET"), 0 }, + { "_COOKIE", sizeof("_COOKIE"), 0 }, + { "_SERVER", sizeof("_SERVER"), 1 }, + { "_ENV", sizeof("_ENV"), 1 }, + { "_FILES", sizeof("_FILES"), 0 }, }; size_t num_track_vars = sizeof(auto_global_records)/sizeof(struct auto_global_record); size_t i; @@ -750,10 +748,6 @@ Z_ADDREF_P(PG(http_globals)[i]); zend_hash_update(&EG(symbol_table), auto_global_records[i].name, auto_global_records[i].name_len, &PG(http_globals)[i], sizeof(zval *), NULL); - if (PG(register_long_arrays)) { - zend_hash_update(&EG(symbol_table), auto_global_records[i].long_name, auto_global_records[i].long_name_len, &PG(http_globals)[i], sizeof(zval *), NULL); - Z_ADDREF_P(PG(http_globals)[i]); - } } /* Create _REQUEST */ @@ -800,11 +794,6 @@ zend_hash_update(&EG(symbol_table), name, name_len + 1, &PG(http_globals)[TRACK_VARS_SERVER], sizeof(zval *), NULL); Z_ADDREF_P(PG(http_globals)[TRACK_VARS_SERVER]); - - if (PG(register_long_arrays)) { - zend_hash_update(&EG(symbol_table), "HTTP_SERVER_VARS", sizeof("HTTP_SERVER_VARS"), &PG(http_globals)[TRACK_VARS_SERVER], sizeof(zval *), NULL); - Z_ADDREF_P(PG(http_globals)[TRACK_VARS_SERVER]); - } return 0; /* don't rearm */ } @@ -827,11 +816,6 @@ zend_hash_update(&EG(symbol_table), name, name_len + 1, &PG(http_globals)[TRACK_VARS_ENV], sizeof(zval *), NULL); Z_ADDREF_P(PG(http_globals)[TRACK_VARS_ENV]); - if (PG(register_long_arrays)) { - zend_hash_update(&EG(symbol_table), "HTTP_ENV_VARS", sizeof("HTTP_ENV_VARS"), &PG(http_globals)[TRACK_VARS_ENV], sizeof(zval *), NULL); - Z_ADDREF_P(PG(http_globals)[TRACK_VARS_ENV]); - } - return 0; /* don't rearm */ } Modified: php/php-src/trunk/php.ini-development =================================================================== --- php/php-src/trunk/php.ini-development 2010-04-15 16:20:13 UTC (rev 298047) +++ php/php-src/trunk/php.ini-development 2010-04-15 16:36:08 UTC (rev 298048) @@ -141,11 +141,6 @@ ; Development Value: Off ; Production Value: Off -; register_long_arrays -; Default Value: On -; Development Value: Off -; Production Value: Off - ; request_order ; Default Value: None ; Development Value: "GP" @@ -686,16 +681,6 @@ ; http://php.net/register-globals register_globals = Off -; Determines whether the deprecated long $HTTP_*_VARS type predefined variables -; are registered by PHP or not. As they are deprecated, we obviously don't -; recommend you use them. They are on by default for compatibility reasons but -; they are not recommended on production servers. -; Default Value: On -; Development Value: Off -; Production Value: Off -; http://php.net/register-long-arrays -register_long_arrays = Off - ; This directive determines whether PHP registers $argv & $argc each time it ; runs. $argv contains an array of all the arguments passed to PHP when a script ; is invoked. $argc contains an integer representing the number of arguments @@ -714,8 +699,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_globals and register_argc_argv +; must be disabled for this directive to have any affect. ; http://php.net/auto-globals-jit auto_globals_jit = On Modified: php/php-src/trunk/php.ini-production =================================================================== --- php/php-src/trunk/php.ini-production 2010-04-15 16:20:13 UTC (rev 298047) +++ php/php-src/trunk/php.ini-production 2010-04-15 16:36:08 UTC (rev 298048) @@ -141,11 +141,6 @@ ; Development Value: Off ; Production Value: Off -; register_long_arrays -; Default Value: On -; Development Value: Off -; Production Value: Off - ; request_order ; Default Value: None ; Development Value: "GP" @@ -686,16 +681,6 @@ ; http://php.net/register-globals register_globals = Off -; Determines whether the deprecated long $HTTP_*_VARS type predefined variables -; are registered by PHP or not. As they are deprecated, we obviously don't -; recommend you use them. They are on by default for compatibility reasons but -; they are not recommended on production servers. -; Default Value: On -; Development Value: Off -; Production Value: Off -; http://php.net/register-long-arrays -register_long_arrays = Off - ; This directive determines whether PHP registers $argv & $argc each time it ; runs. $argv contains an array of all the arguments passed to PHP when a script ; is invoked. $argc contains an integer representing the number of arguments @@ -714,8 +699,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_globals and register_argc_argv +; must be disabled for this directive to have any affect. ; http://php.net/auto-globals-jit auto_globals_jit = On
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php