diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultProvider.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultProvider.java index ca9a8e0581..71cc1fc125 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultProvider.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultProvider.java @@ -15,7 +15,7 @@ public class ExtApiDefinitionExecResultProvider { .append("'") .append(result.getId()) .append("','") - .append(result.getName()) + .append(result.getName().replace("\'", "\\'")) .append("','") .append(result.getResourceId()) .append("','") diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioReportProvider.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioReportProvider.java index 762bbfdbef..924808aab7 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioReportProvider.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioReportProvider.java @@ -17,7 +17,7 @@ public class ExtApiScenarioReportProvider { .append("','") .append(result.getProjectId()) .append("','") - .append(result.getName()) + .append(result.getName().replace("\'", "\\'")) .append("',") .append(result.getCreateTime()) .append(",") @@ -31,7 +31,7 @@ public class ExtApiScenarioReportProvider { .append("','") .append(result.getExecuteType()) .append("','") - .append(result.getScenarioName()) + .append(result.getScenarioName().replace("\'", "\\'")) .append("','") .append(result.getScenarioId()) .append("','")