DeepSeek V4 Pro · Balanced
add-html-sanitizer-for-translated-message-resources-keycloak
Keycloak · Java · M · 100–299 lines · 6 files
The normal review, with one generalist agent. Judge: Claude Opus 5.5.
- Gold bugs found
- 2 of 7
- Comments published
- 4
- Comments matching a bug
- 2
- Comments not matching
- 2
- Cost of this PR
- $0.606
Published comments (4)
PropertyResourceBundle decodes UTF-8 message files as ISO-8859-1 — Non-Latin translations are read as mojibake, so `verifySafeHtml` operates on corrupted strings and its `Illegal HTML` output is garbled for those locales. Use `new PropertyResourceBundle(new InputStreamReader(fis, StandardCharsets.UTF_8))`, including the English bundle nearby.
santizeAnchors compares translation and English anchors by position — A translation that reorders two links is reported as `Didn't find anchor tag ... in original string` and fails the build even though the anchors are unchanged. Match each translation anchor against the set of English anchors rather than requiring identical order.
totpStep1 contains Italian text instead of Lithuanian — Lithuanian-locale users see Italian instructions in the OTP setup flow. Replace `totpStep1` with the correct Lithuanian translation of `Install one of the following applications on your mobile:`. **Also found in:** - `themes/src/main/resources-community/theme/base/login/messages/messages_lt.properties:71-71`
Use i18next {{n}} interpolation for error-invalid-multivalued-size — The single-brace placeholders and the Java `{2,choice,...}` pattern are not interpolated, so `error-invalid-multivalued-size` renders as literal `{0}`/`{2,choice,...}` text when shown via `setUserProfileServerError`. Revert to `{{0}} must have at least {{1}} and at most {{2}}` or use real i18next pluralization. **Also found in:** - `js/apps/account-ui/maven-resources/theme/keycloak.v3/account/messages/messages_en.properties:188-188`