直接在字符串前加tab字符,不用正则匹配,以提高excel导出性能

Signed-off-by: 寄叶 <10877674+LiRui176@user.noreply.gitee.com>
pull/460/head
寄叶 2023-07-06 06:18:15 +00:00 committed by Gitee
parent b36ba5a16c
commit 9251d72c0d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 1 additions and 1 deletions

View File

@ -915,7 +915,7 @@ public class ExcelUtil<T>
// 对于任何以表达式触发字符 =-+@开头的单元格直接使用tab字符作为前缀防止CSV注入。
if (StringUtils.startsWithAny(cellValue, FORMULA_STR))
{
cellValue = RegExUtils.replaceFirst(cellValue, FORMULA_REGEX_STR, "\t$0");
cellValue = "\t" + cellValue;
}
if (value instanceof Collection && StringUtils.equals("[]", cellValue))
{