]> granicus.if.org Git - php/commitdiff
Fix #45820 (Empty ArrayObject keys not allowed)
authorEtienne Kneuss <colder@php.net>
Tue, 30 Dec 2008 23:32:50 +0000 (23:32 +0000)
committerEtienne Kneuss <colder@php.net>
Tue, 30 Dec 2008 23:32:50 +0000 (23:32 +0000)
ext/spl/spl_array.c
ext/spl/tests/array_018.phpt

index d04888667d9870bd6e83eb51540692f3f1bedc50..9228008ad9417fc426862e254745577a1f44c66e 100755 (executable)
@@ -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;
        }
 
index 89f447791913fe146a4041f7cb82c7073188671b..2226421d6d794b8db067dc62776750ab9d985abf 100755 (executable)
Binary files a/ext/spl/tests/array_018.phpt and b/ext/spl/tests/array_018.phpt differ