Skip to content

Commit

Permalink
MFH: Fix #45820 (Empty ArrayObject keys not allowed)
Browse files Browse the repository at this point in the history
  • Loading branch information
colder committed Dec 30, 2008
1 parent 826cc0d commit b296c25
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ PHP NEWS
(Scott)
- Fixed bug #45989 (json_decode() doesn't return NULL on certain invalid
strings). (magicaltux, Scott)
- Fixed bug #45820 (Allow empty keys in ArrayObject). (Etienne)
- Fixed bug #45791 (json_decode() doesn't convert 0e0 to a double). (Scott)

04 Dec 2008, PHP 5.3.0 Alpha 3
Expand Down
4 changes: 0 additions & 4 deletions ext/spl/spl_array.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,10 +433,6 @@ static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval
}
switch(Z_TYPE_P(offset)) {
case IS_STRING:
if (*Z_STRVAL_P(offset) == '\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_symtable_update(spl_array_get_hash_table(intern, 0 TSRMLS_CC), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void**)&value, sizeof(void*), NULL);
return;
Expand Down
Binary file modified ext/spl/tests/array_018.phpt
Binary file not shown.

0 comments on commit b296c25

Please sign in to comment.