Skip to content

Commit f247572

Browse files
committed
Update: format is empty in object_format
1 parent 2011ae9 commit f247572

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

kernel/common.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ lxw_format* object_format(xls_object *obj, zend_string *format, lxw_format *form
114114
}
115115

116116
if (format != NULL && format_handle != NULL) {
117+
if (format->len <= 0) {
118+
return format_handle;
119+
}
120+
117121
zend_string *_format_key = strpprintf(0, "%p|%s", format_handle, format->val);
118122

119123
void *exit_format = zend_hash_str_find_ptr(obj->formats_cache_ptr.maps, ZEND_STRL(_format_key->val));
@@ -136,6 +140,10 @@ lxw_format* object_format(xls_object *obj, zend_string *format, lxw_format *form
136140
}
137141

138142
if (format != NULL) {
143+
if (format->len <= 0) {
144+
return NULL;
145+
}
146+
139147
void *exit_format = zend_hash_str_find_ptr(obj->formats_cache_ptr.maps, ZEND_STRL(format->val));
140148

141149
if (exit_format != NULL) {

0 commit comments

Comments
 (0)