@@ -5314,8 +5314,19 @@ PHP_METHOD(DatePeriod, __wakeup)
5314
5314
static zval * date_period_read_property (zval * object , zval * member , int type , void * * cache_slot , zval * rv )
5315
5315
{
5316
5316
if (type != BP_VAR_IS && type != BP_VAR_R ) {
5317
- zend_throw_error (NULL , "Retrieval of DatePeriod properties for modification is unsupported" );
5318
- return & EG (uninitialized_zval );
5317
+ zend_string * name = zval_get_string (member );
5318
+ if (zend_string_equals_literal (name , "recurrences" )
5319
+ || zend_string_equals_literal (name , "include_start_date" )
5320
+ || zend_string_equals_literal (name , "start" )
5321
+ || zend_string_equals_literal (name , "current" )
5322
+ || zend_string_equals_literal (name , "end" )
5323
+ || zend_string_equals_literal (name , "interval" )
5324
+ ) {
5325
+ zend_throw_error (NULL , "Retrieval of DatePeriod->%s for modification is unsupported" , ZSTR_VAL (name ));
5326
+ zend_string_release (name );
5327
+ return & EG (uninitialized_zval );
5328
+ }
5329
+ zend_string_release (name );
5319
5330
}
5320
5331
5321
5332
Z_OBJPROP_P (object ); /* build properties hash table */
@@ -5327,7 +5338,21 @@ static zval *date_period_read_property(zval *object, zval *member, int type, voi
5327
5338
/* {{{ date_period_write_property */
5328
5339
static void date_period_write_property (zval * object , zval * member , zval * value , void * * cache_slot )
5329
5340
{
5330
- zend_throw_error (NULL , "Writing to DatePeriod properties is unsupported" );
5341
+ zend_string * name = zval_get_string (member );
5342
+ if (zend_string_equals_literal (name , "recurrences" )
5343
+ || zend_string_equals_literal (name , "include_start_date" )
5344
+ || zend_string_equals_literal (name , "start" )
5345
+ || zend_string_equals_literal (name , "current" )
5346
+ || zend_string_equals_literal (name , "end" )
5347
+ || zend_string_equals_literal (name , "interval" )
5348
+ ) {
5349
+ zend_throw_error (NULL , "Writing to DatePeriod->%s is unsupported" , ZSTR_VAL (name ));
5350
+ zend_string_release (name );
5351
+ return ;
5352
+ }
5353
+ zend_string_release (name );
5354
+
5355
+ std_object_handlers .write_property (object , member , value , cache_slot );
5331
5356
}
5332
5357
/* }}} */
5333
5358
0 commit comments