summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorEtienne Kneuss <colder@php.net>2008-12-30 23:32:50 +0000
committerEtienne Kneuss <colder@php.net>2008-12-30 23:32:50 +0000
commit040585ddfc21f0eaf1f6bfa17781b091e1616228 (patch)
tree1cf94fa9d2d588f689600027076741d0f5dc5cbb /ext
parent16e60294d8bde8e4392b47267951190a31c2eeb9 (diff)
downloadphp-git-040585ddfc21f0eaf1f6bfa17781b091e1616228.tar.gz
Fix #45820 (Empty ArrayObject keys not allowed)
Diffstat (limited to 'ext')
-rwxr-xr-xext/spl/spl_array.c7
-rwxr-xr-xext/spl/tests/array_018.phptbin694 -> 641 bytes
2 files changed, 1 insertions, 6 deletions
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
--- a/ext/spl/tests/array_018.phpt
+++ b/ext/spl/tests/array_018.phpt
Binary files differ