From f247572196e2296d652407baf565f7c789764170 Mon Sep 17 00:00:00 2001 From: viest Date: Sun, 10 Nov 2024 09:33:57 +0800 Subject: [PATCH] Update: format is empty in object_format --- kernel/common.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kernel/common.c b/kernel/common.c index 06e3a99..4fccaa7 100644 --- a/kernel/common.c +++ b/kernel/common.c @@ -114,6 +114,10 @@ lxw_format* object_format(xls_object *obj, zend_string *format, lxw_format *form } if (format != NULL && format_handle != NULL) { + if (format->len <= 0) { + return format_handle; + } + zend_string *_format_key = strpprintf(0, "%p|%s", format_handle, format->val); 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 } if (format != NULL) { + if (format->len <= 0) { + return NULL; + } + void *exit_format = zend_hash_str_find_ptr(obj->formats_cache_ptr.maps, ZEND_STRL(format->val)); if (exit_format != NULL) {