SEBSERV-444 fixed also in exam delete message

This commit is contained in:
anhefti 2023-06-15 10:43:37 +02:00
parent 4b051fbc97
commit 768fcea15b
4 changed files with 6 additions and 5 deletions

View file

@ -16,6 +16,7 @@ import java.util.function.Predicate;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import org.apache.commons.text.StringEscapeUtils;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
@ -161,7 +162,7 @@ public class ExamDeletePopup {
new ActionEvent(action),
action.pageContext());
final String examName = examToDelete.toName().name;
final String examName = StringEscapeUtils.escapeXml11(examToDelete.toName().name);
final List<EntityKey> dependencies = report.results.stream()
.filter(key -> !key.equals(entityKey))
.collect(Collectors.toList());

View file

@ -46,7 +46,7 @@ public final class Message extends MessageBox {
super.prepareOpen();
} catch (final IllegalArgumentException e) {
// fallback on markup text error
super.setMessage(StringEscapeUtils.escapeHtml4(super.getMessage()));
super.setMessage(StringEscapeUtils.escapeXml11(super.getMessage()));
super.prepareOpen();
}
final GridLayout layout = (GridLayout) super.shell.getLayout();

View file

@ -63,7 +63,7 @@ public class MockCourseAccessAPI implements CourseAccessAPI {
"quiz1", institutionId, lmsSetupId, lmsType, "Demo Quiz 1 (MOCKUP)", "<p>Demo Quiz Mockup</p>",
"2020-01-01T09:00:00Z", null, "http://lms.mockup.com/api/"));
this.mockups.add(new QuizData(
"quiz2", institutionId, lmsSetupId, lmsType, "Demo Quiz 2 (MOCKUP) äöüèÜÄÖ ?< ",
"quiz2 äöüèÜÄÖ ?<", institutionId, lmsSetupId, lmsType, "Demo Quiz 2 (MOCKUP) äöüèÜÄÖ ?< ",
"<p>Demo Quiz Mockup</p>",
"2020-01-01T09:00:00Z", "2025-01-01T09:00:00Z", "http://lms.mockup.com/api/"));
this.mockups.add(new QuizData(

View file

@ -36,12 +36,12 @@ public class ExamAPITest extends AdministrationAPIIntegrationTester {
sebAdminAccess,
sebAdminAccess,
"LmsSetupMock",
"quiz2",
"quiz2 äöüèÜÄÖ ?<",
ExamType.MANAGED,
"user5");
assertNotNull(exam);
assertEquals("quiz2", exam.getExternalId());
assertEquals("quiz2 äöüèÜÄÖ ?<", exam.getExternalId()); // Note cannot set right collation on h2
assertEquals(ExamType.MANAGED, exam.getType());
assertFalse(exam.getSupporter().isEmpty());