MiniMax M3 · 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 Haiku 5.5.
- Gold bugs found
- 0 of 2
- Comments published
- 4
- Comments matching a bug
- 0
- Comments not matching
- 4
- Cost of this PR
- $0.311
Published comments (4)
ANCHOR_PATTERN matches any tag starting with 'a', not only anchor tags — Tighten it to `</?a(\s|>|/>)` so only real `<a>`/`</a>` tokens match.
verifySafeHtml throws RuntimeException for English file, bypassing Mojo error handling — A missing English file in `verifySafeHtml` aborts the Maven build with an unhandled stack trace because `verify` only catches `IOException`. Throw `MojoExecutionException` so the failure flows through `ThemeVerifierMojo.execute`'s normal validation channel.
santizeAnchors reports a failure but caller still adds an overlapping illegal-HTML message — When `santizeAnchors` flags an anchor mismatch, `verifySafeHtml` still sanitizes the same string, so each bad key produces two overlapping messages ('Didn't find anchor…' and 'Illegal HTML in key…'). Have `santizeAnchors` signal failure (e.g. return null) so the caller skips the redundant sanitize.
santizeAnchors strips a stale match because the matcher is anchored to the original value — In `santizeAnchors`, the matcher stays bound to the original `value` while `replaceFirst` mutates it, so the substring stripped is no longer the one just visited. Rebuild the matcher each iteration, or collect anchors first and apply them on a fresh pass.
Gold bugs found (0)
None.