mirror of
https://github.com/dataease/dataease.git
synced 2026-05-15 05:22:13 +08:00
fix(图表): 修复下钻字段包含’\‘时下钻失败 #13031
This commit is contained in:
@@ -335,6 +335,7 @@ public class ChartDataManage {
|
||||
extFilterList = extFilterList.stream().peek(ele -> {
|
||||
if (ObjectUtils.isNotEmpty(ele.getValue())) {
|
||||
List<String> collect = ele.getValue().stream().map(SQLUtils::transKeyword).collect(Collectors.toList());
|
||||
ele.setOriginValue(ele.getValue());
|
||||
ele.setValue(collect);
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.util.Optional;
|
||||
*/
|
||||
public class SQLUtils {
|
||||
public static String transKeyword(String value) {
|
||||
return Optional.ofNullable(value).orElse("").replaceAll("'", "''");
|
||||
return Optional.ofNullable(value).orElse("").replaceAll("'", "''").replaceAll("\\\\","\\\\\\\\");
|
||||
}
|
||||
|
||||
public static String buildOriginPreviewSql(String sql, int limit, int offset) {
|
||||
|
||||
Reference in New Issue
Block a user