diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2007-02-06 00:01:18 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2007-02-06 00:01:18 +0000 |
commit | 629d7cf43f5ac1be56e5205cc6f6be2f43d1d963 (patch) | |
tree | 565934dd3561888b3e836ad5f8580bbe56e4161a /ext/session/php_session.h | |
parent | 871fb78154ad05d1a10883667b6aacc63cca0e0e (diff) | |
download | php-git-629d7cf43f5ac1be56e5205cc6f6be2f43d1d963.tar.gz |
Fixed Bug #40274 (Sessions fail with numeric root keys).
Diffstat (limited to 'ext/session/php_session.h')
-rw-r--r-- | ext/session/php_session.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/session/php_session.h b/ext/session/php_session.h index f0e365cffb..0ad48e8fa8 100644 --- a/ext/session/php_session.h +++ b/ext/session/php_session.h @@ -223,11 +223,16 @@ PHPAPI const ps_serializer *_php_find_ps_serializer(char *name TSRMLS_DC); #define PS_ENCODE_LOOP(code) do { \ HashTable *_ht = Z_ARRVAL_P(PS(http_session_vars)); \ + int key_type; \ \ for (zend_hash_internal_pointer_reset(_ht); \ - zend_hash_get_current_key_ex(_ht, &key, &key_length, &num_key, 0, NULL) == HASH_KEY_IS_STRING; \ + (key_type = zend_hash_get_current_key_ex(_ht, &key, &key_length, &num_key, 0, NULL)) != HASH_KEY_NON_EXISTANT; \ zend_hash_move_forward(_ht)) { \ - key_length--; \ + if (key_type == HASH_KEY_IS_LONG) { \ + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Skipping numeric key %ld.", num_key); \ + continue; \ + } \ + key_length--; \ if (php_get_session_var(key, key_length, &struc TSRMLS_CC) == SUCCESS) { \ code; \ } \ |