- Intl:
. Fix null pointer dereferences in some classes of ext/intl. (Gustavo)
+ . Fix bug #62915 (defective cloning in several intl classes). (Gustavo)
- MySQLnd:
. Fixed bug #62885 (mysqli_poll - Segmentation fault). (Laruence)
DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK;
- new_obj_val = IntlDateFormatter_ce_ptr->create_object(IntlDateFormatter_ce_ptr TSRMLS_CC);
+ new_obj_val = IntlDateFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
new_dfo = (IntlDateFormatter_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC);
/* clone standard parts */
zend_objects_clone_members(&new_dfo->zo, new_obj_val, &dfo->zo, handle TSRMLS_CC);
NumberFormatter_object *nfo, *new_nfo;
FORMATTER_METHOD_FETCH_OBJECT_NO_CHECK;
- new_obj_val = NumberFormatter_ce_ptr->create_object(NumberFormatter_ce_ptr TSRMLS_CC);
+ new_obj_val = NumberFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
new_nfo = (NumberFormatter_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC);
/* clone standard parts */
zend_objects_clone_members(&new_nfo->zo, new_obj_val, &nfo->zo, handle TSRMLS_CC);
MessageFormatter_object *mfo, *new_mfo;
MSG_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK;
- new_obj_val = MessageFormatter_ce_ptr->create_object(MessageFormatter_ce_ptr TSRMLS_CC);
+ new_obj_val = MessageFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
new_mfo = (MessageFormatter_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC);
/* clone standard parts */
zend_objects_clone_members(&new_mfo->zo, new_obj_val, &mfo->zo, handle TSRMLS_CC);
--- /dev/null
+--TEST--
+Bug #62915: cloning of several classes is defective
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+ die('skip intl extension not enabled');
+--FILE--
+<?php
+class A extends IntlDateFormatter {
+ static $ARGS = array("en_US" ,IntlDateFormatter::FULL, IntlDateFormatter::FULL,
+ 'America/Los_Angeles', IntlDateFormatter::GREGORIAN);
+}
+class B extends NumberFormatter {
+ static $ARGS = array('de_DE', NumberFormatter::DECIMAL);
+}
+class C extends MessageFormatter {
+ static $ARGS = array("en_US", "foo");
+}
+
+foreach (range('A', 'C') as $subclass) {
+ $rc = new ReflectionClass($subclass);
+ $obj = $rc->newInstanceArgs($subclass::$ARGS);
+ $clone = clone $obj;
+ var_dump(get_class($clone));
+}
+--EXPECT--
+string(1) "A"
+string(1) "B"
+string(1) "C"