|
12 | 12 | import lombok.RequiredArgsConstructor;
|
13 | 13 | import lombok.extern.slf4j.Slf4j;
|
14 | 14 | import org.apache.commons.lang3.StringUtils;
|
| 15 | +import org.apache.commons.text.StringEscapeUtils; |
15 | 16 | import org.springframework.http.HttpStatus;
|
16 | 17 | import org.springframework.security.core.Authentication;
|
17 | 18 | import org.springframework.security.core.context.SecurityContextHolder;
|
@@ -74,13 +75,14 @@ public void deleteChecklist(final UUID checklistId) {
|
74 | 75 |
|
75 | 76 | public Checklist changeChecklistEntry(final UUID checklistId, final String serviceId, ZonedDateTime newCheckedValue) {
|
76 | 77 | final String lhmExtId = getLhmExtIdFromAuthenticationOrThrow();
|
77 |
| - log.debug("Update checklist with checklist-ID {} and service-ID {} for {}", checklistId, serviceId, lhmExtId); |
| 78 | + final String sanitizedServiceId = StringEscapeUtils.escapeHtml4(serviceId); |
| 79 | + log.debug("Update checklist with checklist-ID {} and service-ID {} for {}", checklistId, sanitizedServiceId, lhmExtId); |
78 | 80 | final Checklist foundChecklist = getChecklistOrThrowException(checklistId);
|
79 | 81 |
|
80 | 82 | isChecklistOwnerOrThrow(foundChecklist, lhmExtId);
|
81 | 83 |
|
82 |
| - foundChecklist.getChecklistItems().stream().forEach(checklistItem -> { |
83 |
| - if(checklistItem.getServiceID().equals(serviceId)) { |
| 84 | + foundChecklist.getChecklistItems().forEach(checklistItem -> { |
| 85 | + if(checklistItem.getServiceID().equals(sanitizedServiceId)) { |
84 | 86 | checklistItem.setChecked(newCheckedValue);
|
85 | 87 | }
|
86 | 88 | });
|
|
0 commit comments