diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/monitoring/MonitoringRunningExam.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/monitoring/MonitoringRunningExam.java index 530e0630..ea3664ac 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/monitoring/MonitoringRunningExam.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/monitoring/MonitoringRunningExam.java @@ -18,6 +18,7 @@ import java.util.function.BooleanSupplier; import java.util.function.Consumer; import java.util.function.Function; +import org.apache.commons.text.StringEscapeUtils; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; @@ -151,7 +152,9 @@ public class MonitoringRunningExam implements TemplateComposer { final Composite content = this.pageService.getWidgetFactory().defaultPageLayout( pageContext.getParent(), - new LocTextKey("sebserver.monitoring.exam", exam.name)); + new LocTextKey( + "sebserver.monitoring.exam", + StringEscapeUtils.escapeHtml4(exam.name))); final Composite tablePane = new Composite(content, SWT.NONE); tablePane.setLayout(new GridLayout()); diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/i18n/impl/PolyglotPageServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/i18n/impl/PolyglotPageServiceImpl.java index 1a669a7f..e4a2cd3d 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/service/i18n/impl/PolyglotPageServiceImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/i18n/impl/PolyglotPageServiceImpl.java @@ -11,9 +11,7 @@ package ch.ethz.seb.sebserver.gui.service.i18n.impl; import java.util.Locale; import java.util.function.Consumer; -import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; -import org.apache.commons.text.StringEscapeUtils; import org.eclipse.rap.rwt.RWT; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Button; @@ -279,14 +277,8 @@ public final class PolyglotPageServiceImpl implements PolyglotPageService { final I18nSupport i18nSupport) { return label -> { - if (locTextKey != null) { - final String text = i18nSupport.getText(locTextKey); - if (BooleanUtils.toBoolean((Boolean) label.getData(RWT.MARKUP_ENABLED))) { - label.setText(StringEscapeUtils.escapeHtml4(text)); - } else { - label.setText(text); - } + label.setText(i18nSupport.getText(locTextKey)); } if (i18nSupport.hasText(locToolTipKey)) { label.setToolTipText(Utils.formatLineBreaks(i18nSupport.getText(locToolTipKey)));