File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -773,7 +773,7 @@ PHP_METHOD(vtiful_xls, insertDate)
773773{
774774 zval * data = NULL , * format_handle = NULL ;
775775 zend_long row = 0 , column = 0 ;
776- zend_string * format = NULL ;
776+ zend_string * format = NULL , * default_format = NULL ;
777777
778778 ZEND_PARSE_PARAMETERS_START (3 , 5 )
779779 Z_PARAM_LONG (row )
@@ -798,7 +798,8 @@ PHP_METHOD(vtiful_xls, insertDate)
798798
799799 // Default datetime format
800800 if (format == NULL || (format != NULL && ZSTR_LEN (format ) == 0 )) {
801- format = zend_string_init (ZEND_STRL ("yyyy-mm-dd hh:mm:ss" ), 0 );
801+ default_format = zend_string_init (ZEND_STRL ("yyyy-mm-dd hh:mm:ss" ), 0 );
802+ format = default_format ;
802803 }
803804
804805 lxw_datetime datetime = timestamp_to_datetime (data -> value .lval );
@@ -810,8 +811,8 @@ PHP_METHOD(vtiful_xls, insertDate)
810811 }
811812
812813 // Release default format
813- if (ZEND_NUM_ARGS () == 3 ) {
814- zend_string_release (format );
814+ if (default_format != NULL ) {
815+ zend_string_release (default_format );
815816 }
816817}
817818/* }}} */
You can’t perform that action at this time.
0 commit comments