diff options
author | Sascha Schumann <sas@php.net> | 2002-10-07 02:37:50 +0000 |
---|---|---|
committer | Sascha Schumann <sas@php.net> | 2002-10-07 02:37:50 +0000 |
commit | 2dde6fb594a1c90a30ecd0cda20e562e37ad58e9 (patch) | |
tree | e3c8a3839f21038f89b61301fe295debc9eaed11 /ext/session | |
parent | 5c782303a1a3a21e4e33589678814a9e3f4f23f5 (diff) | |
download | php-git-2dde6fb594a1c90a30ecd0cda20e562e37ad58e9.tar.gz |
Print out warning only, if a variable was actually migrated
Diffstat (limited to 'ext/session')
-rw-r--r-- | ext/session/session.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/session/session.c b/ext/session/session.c index 8dce8245a5..08e717058b 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -611,13 +611,14 @@ static void php_session_initialize(TSRMLS_D) } } -static void migrate_global(HashTable *ht, HashPosition *pos TSRMLS_DC) +static int migrate_global(HashTable *ht, HashPosition *pos TSRMLS_DC) { char *str; uint str_len; ulong num_key; int n; zval **val = NULL; + int ret = 0; n = zend_hash_get_current_key_ex(ht, &str, &str_len, &num_key, 0, pos); @@ -626,6 +627,7 @@ static void migrate_global(HashTable *ht, HashPosition *pos TSRMLS_DC) zend_hash_find(&EG(symbol_table), str, str_len, (void **) &val); if (val) { ZEND_SET_SYMBOL_WITH_LENGTH(ht, str, str_len, *val, (*val)->refcount + 1 , 1); + ret = 1; } break; case HASH_KEY_IS_LONG: @@ -634,6 +636,8 @@ static void migrate_global(HashTable *ht, HashPosition *pos TSRMLS_DC) "numeric nature.", num_key); break; } + + return ret; } static void php_session_save_current_state(TSRMLS_D) @@ -652,9 +656,8 @@ static void php_session_save_current_state(TSRMLS_D) while (zend_hash_get_current_data_ex(ht, (void **) &val, &pos) != FAILURE) { if (Z_TYPE_PP(val) == IS_NULL) { - do_warn = 1; - - migrate_global(ht, &pos TSRMLS_CC); + if (migrate_global(ht, &pos TSRMLS_CC)) + do_warn = 1; } zend_hash_move_forward_ex(ht, &pos); } |