kalle Thu, 22 Apr 2010 01:07:48 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=298290
Log:
Removed the session 4.2 bug compatibility mode
Changed paths:
U php/php-src/trunk/NEWS
U php/php-src/trunk/ext/session/php_session.h
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/009.phpt
U php/php-src/trunk/ext/session/tests/010.phpt
U php/php-src/trunk/ext/session/tests/011.phpt
U php/php-src/trunk/ext/session/tests/012.phpt
U php/php-src/trunk/ext/session/tests/013.phpt
U php/php-src/trunk/ext/session/tests/014.phpt
Modified: php/php-src/trunk/NEWS
===================================================================
--- php/php-src/trunk/NEWS 2010-04-21 23:41:51 UTC (rev 298289)
+++ php/php-src/trunk/NEWS 2010-04-22 01:07:48 UTC (rev 298290)
@@ -35,6 +35,8 @@
. import_request_variables().
. register_globals.
. register_long_arrays ini option.
+ . Session bug compatibility mode (session.bug_compat42 and
+ session.bug_compat_warn ini options).
. session_is_registered(), session_register() and session_unregister()
functions.
. y2k_compliance ini option.
Modified: php/php-src/trunk/ext/session/php_session.h
===================================================================
--- php/php-src/trunk/ext/session/php_session.h 2010-04-21 23:41:51 UTC (rev
298289)
+++ php/php-src/trunk/ext/session/php_session.h 2010-04-22 01:07:48 UTC (rev
298290)
@@ -127,8 +127,6 @@
zval *ps_gc;
} name;
} mod_user_names;
- zend_bool bug_compat; /* Whether to behave like PHP 4.2 and earlier */
- zend_bool bug_compat_warn; /* Whether to warn about it */
const struct ps_serializer_struct *serializer;
zval *http_session_vars;
zend_bool auto_start;
Modified: php/php-src/trunk/ext/session/session.c
===================================================================
--- php/php-src/trunk/ext/session/session.c 2010-04-21 23:41:51 UTC (rev
298289)
+++ php/php-src/trunk/ext/session/session.c 2010-04-22 01:07:48 UTC (rev
298290)
@@ -439,63 +439,11 @@
}
/* }}} */
-static int migrate_global(HashTable *ht, HashPosition *pos TSRMLS_DC) /* {{{ */
-{
- char *str;
- uint str_len;
- ulong num_key;
- int n;
- zval **val;
- int ret = 0;
-
- n = zend_hash_get_current_key_ex(ht, &str, &str_len, &num_key, 0, pos);
-
- switch (n) {
- case HASH_KEY_IS_STRING:
- if (zend_hash_find(&EG(symbol_table), str, str_len,
(void **) &val) == SUCCESS &&
- val && Z_TYPE_PP(val) != IS_NULL
- ) {
- ZEND_SET_SYMBOL_WITH_LENGTH(ht, str, str_len,
*val, Z_REFCOUNT_PP(val) + 1, 1);
- ret = 1;
- }
- break;
- case HASH_KEY_IS_LONG:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "The session
bug compatibility code will not "
- "try to locate the global variable $%lu
due to its "
- "numeric nature", num_key);
- break;
- }
- return ret;
-}
-/* }}} */
-
static void php_session_save_current_state(TSRMLS_D) /* {{{ */
{
int ret = FAILURE;
IF_SESSION_VARS() {
- if (PS(bug_compat)) {
- HashTable *ht = Z_ARRVAL_P(PS(http_session_vars));
- HashPosition pos;
- zval **val;
- int do_warn = 0;
-
- zend_hash_internal_pointer_reset_ex(ht, &pos);
-
- while (zend_hash_get_current_data_ex(ht, (void **)
&val, &pos) != FAILURE) {
- if (Z_TYPE_PP(val) == IS_NULL) {
- if (migrate_global(ht, &pos TSRMLS_CC))
{
- do_warn = 1;
- }
- }
- zend_hash_move_forward_ex(ht, &pos);
- }
-
- 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. You can disable this functionality and this
warning by setting session.bug_compat_42 or session.bug_compat_warn to off,
respectively");
- }
- }
-
if (PS(mod_data)) {
char *val;
int vallen;
@@ -684,8 +632,6 @@
/* {{{ PHP_INI
*/
PHP_INI_BEGIN()
- STD_PHP_INI_BOOLEAN("session.bug_compat_42", "1",
PHP_INI_ALL, OnUpdateBool, bug_compat, php_ps_globals, ps_globals)
- STD_PHP_INI_BOOLEAN("session.bug_compat_warn", "1",
PHP_INI_ALL, OnUpdateBool, bug_compat_warn, php_ps_globals, ps_globals)
STD_PHP_INI_ENTRY("session.save_path", "",
PHP_INI_ALL, OnUpdateSaveDir,save_path, php_ps_globals, ps_globals)
STD_PHP_INI_ENTRY("session.name", "PHPSESSID",
PHP_INI_ALL, OnUpdateString, session_name, php_ps_globals, ps_globals)
PHP_INI_ENTRY("session.save_handler", "files",
PHP_INI_ALL, OnUpdateSaveHandler)
Modified: php/php-src/trunk/ext/session/tests/007.phpt
===================================================================
--- php/php-src/trunk/ext/session/tests/007.phpt 2010-04-21 23:41:51 UTC
(rev 298289)
+++ php/php-src/trunk/ext/session/tests/007.phpt 2010-04-22 01:07:48 UTC
(rev 298290)
@@ -5,7 +5,6 @@
--INI--
session.use_cookies=0
session.cache_limiter=
-session.bug_compat_42=1
session.serialize_handler=php
session.save_handler=files
precision=14
Modified: php/php-src/trunk/ext/session/tests/009.phpt
===================================================================
--- php/php-src/trunk/ext/session/tests/009.phpt 2010-04-21 23:41:51 UTC
(rev 298289)
+++ php/php-src/trunk/ext/session/tests/009.phpt 2010-04-22 01:07:48 UTC
(rev 298290)
@@ -5,8 +5,6 @@
--INI--
session.use_cookies=0
session.cache_limiter=
-session.bug_compat_42=1
-session.bug_compat_warn=0
session.serialize_handler=php
session.save_handler=files
--FILE--
Modified: php/php-src/trunk/ext/session/tests/010.phpt
===================================================================
--- php/php-src/trunk/ext/session/tests/010.phpt 2010-04-21 23:41:51 UTC
(rev 298289)
+++ php/php-src/trunk/ext/session/tests/010.phpt 2010-04-22 01:07:48 UTC
(rev 298290)
@@ -5,8 +5,6 @@
--INI--
session.use_cookies=0
session.cache_limiter=
-session.bug_compat_42=1
-session.bug_compat_warn=0
--FILE--
<?php
error_reporting(E_ALL);
Modified: php/php-src/trunk/ext/session/tests/011.phpt
===================================================================
--- php/php-src/trunk/ext/session/tests/011.phpt 2010-04-21 23:41:51 UTC
(rev 298289)
+++ php/php-src/trunk/ext/session/tests/011.phpt 2010-04-22 01:07:48 UTC
(rev 298290)
@@ -5,8 +5,6 @@
--INI--
session.use_cookies=0
session.cache_limiter=
-session.bug_compat_42=1
-session.bug_compat_warn=0
--FILE--
<?php
error_reporting(E_ALL);
Modified: php/php-src/trunk/ext/session/tests/012.phpt
===================================================================
--- php/php-src/trunk/ext/session/tests/012.phpt 2010-04-21 23:41:51 UTC
(rev 298289)
+++ php/php-src/trunk/ext/session/tests/012.phpt 2010-04-22 01:07:48 UTC
(rev 298290)
@@ -5,8 +5,6 @@
--INI--
session.use_cookies=0
session.cache_limiter=
-session.bug_compat_42=1
-session.bug_compat_warn=0
session.serialize_handler=php
session.save_handler=files
--FILE--
Modified: php/php-src/trunk/ext/session/tests/013.phpt
===================================================================
--- php/php-src/trunk/ext/session/tests/013.phpt 2010-04-21 23:41:51 UTC
(rev 298289)
+++ php/php-src/trunk/ext/session/tests/013.phpt 2010-04-22 01:07:48 UTC
(rev 298290)
@@ -5,8 +5,6 @@
--INI--
session.use_cookies=0
session.cache_limiter=
-session.bug_compat_42=1
-session.bug_compat_warn=0
session.serialize_handler=php
session.save_handler=files
--FILE--
Modified: php/php-src/trunk/ext/session/tests/014.phpt
===================================================================
--- php/php-src/trunk/ext/session/tests/014.phpt 2010-04-21 23:41:51 UTC
(rev 298289)
+++ php/php-src/trunk/ext/session/tests/014.phpt 2010-04-22 01:07:48 UTC
(rev 298290)
@@ -6,8 +6,6 @@
session.use_trans_sid=0
session.use_cookies=0
session.cache_limiter=
-session.bug_compat_42=1
-session.bug_compat_warn=0
session.name=PHPSESSID
session.serialize_handler=php
session.save_handler=files
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php