From: Etienne Kneuss Date: Tue, 30 Dec 2008 23:32:50 +0000 (+0000) Subject: Fix #45820 (Empty ArrayObject keys not allowed) X-Git-Tag: php-5.4.0alpha1~191^2~4709 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=040585ddfc21f0eaf1f6bfa17781b091e1616228;p=php Fix #45820 (Empty ArrayObject keys not allowed) --- diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index d04888667d..9228008ad9 100755 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -436,11 +436,6 @@ static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval switch(Z_TYPE_P(offset)) { case IS_STRING: case IS_UNICODE: - /* FIXME: Unicode support??? */ - if (Z_STRVAL_P(offset)[0] == '\0') { - zend_throw_exception(spl_ce_InvalidArgumentException, "An offset must not begin with \\0 or be empty", 0 TSRMLS_CC); - return; - } Z_ADDREF_P(value); zend_u_symtable_update(spl_array_get_hash_table(intern, 0 TSRMLS_CC), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, (void**)&value, sizeof(void*), NULL); return; @@ -1712,7 +1707,7 @@ SPL_METHOD(Array, unserialize) } if (buf_len == 0) { - zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Empty serialized string cannot be empty"); + zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Serialized string cannot be empty"); return; } diff --git a/ext/spl/tests/array_018.phpt b/ext/spl/tests/array_018.phpt index 89f4477919..2226421d6d 100755 Binary files a/ext/spl/tests/array_018.phpt and b/ext/spl/tests/array_018.phpt differ