colder Tue Dec 30 23:32:50 2008 UTC
Modified files:
/php-src/ext/spl spl_array.c
/php-src/ext/spl/tests array_018.phpt
Log:
Fix #45820 (Empty ArrayObject keys not allowed)
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_array.c?r1=1.159&r2=1.160&diff_format=u
Index: php-src/ext/spl/spl_array.c
diff -u php-src/ext/spl/spl_array.c:1.159 php-src/ext/spl/spl_array.c:1.160
--- php-src/ext/spl/spl_array.c:1.159 Wed Nov 19 17:54:24 2008
+++ php-src/ext/spl/spl_array.c Tue Dec 30 23:32:50 2008
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_array.c,v 1.159 2008/11/19 17:54:24 lbarnaud Exp $ */
+/* $Id: spl_array.c,v 1.160 2008/12/30 23:32:50 colder Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -436,11 +436,6 @@
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 @@
}
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;
}
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/array_018.phpt?r1=1.4&r2=1.5&diff_format=u
Index: php-src/ext/spl/tests/array_018.phpt
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php