mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-25 17:22:55 +00:00
fix: Excel export prohibits inputting external links or formulas (#3106)
This commit is contained in:
parent
5e0d8048f9
commit
a1a92a833a
|
|
@ -662,8 +662,7 @@ class DocumentSerializers(ApiMixin, serializers.Serializer):
|
|||
if isinstance(col, str):
|
||||
col = re.sub(ILLEGAL_CHARACTERS_RE, '', col)
|
||||
if col.startswith(('=', '+', '-', '@')):
|
||||
cell.value = '\ufeff' + col
|
||||
else:
|
||||
col = '\ufeff' + col
|
||||
cell.value = col
|
||||
# 创建HttpResponse对象返回Excel文件
|
||||
return workbook
|
||||
|
|
|
|||
Loading…
Reference in New Issue