Skip to content

Escape user names, commenter details and tag names where they are output - #330

Merged
mraible merged 1 commit into
roller-6.1.xfrom
escape-user-display-names-6.1.x
Nov 18, 2026
Merged

mraible merged 1 commit into
roller-6.1.xfrom
escape-user-display-names-6.1.x

Conversation

@mraible

@mraible mraible commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

The 6.1.x version of #318. The planet JSPs keep 6.1.x's markup with master's data-* attributes, and PingTargets.jsp, which only 6.1.x has, now passes ping target ids, names and URLs to its handlers through data-* attributes too, since the new JspOutputEncodingTest rule flagged it. jackson-databind 2.22.3 is added at test scope for two tests that parse JSON.

Fourteen of the 41 new and changed test cases fail without the change. mvn test passes (548 run, 1 skipped), and the Selenium integration tests pass.

CHANGES entries for the 6.1.8 fixes will come in one PR.

UserWrapper now returns screen and full names as HTML-escaped text, encoding them exactly once whether they were stored as typed or already encoded by the sanitizer, and the built-in feed macros turn them back into text before XML-escaping them for Atom author names and RSS dc:creator.

HTML comment notification emails escape the commenter's name and email address. WeblogEntryCommentWrapper escapes HTML comments when the HTMLSubset plugin isn't both configured and listed on the comment, and its Javadoc now describes what getContent does.

Utilities.transformToHTMLSubset and addNofollow find each link's closing bracket with one forward search and stop when none is left, so their time is linear in the input, and addNofollow now adds rel="nofollow" to links that don't already have it.

TagDataServlet writes tag names and the weblog handle with JSON and XML escaping. The planet group pages pass handles and feed URLs to their delete handlers through data attributes, and JspOutputEncodingTest rejects property values inside inline event handlers. CommentDataServlet returns comment content as JSON, which Comments.jsp reads with jQuery's json data type, and UserDataServlet declares its plain text response.

WeblogEntryCommentWrapper.getContent now HTML-escapes any comment that isn't text/html with the HTMLSubset plugin applied, including comments without a content type.

The ping target page passes ping target ids, names and URLs to its edit and delete handlers through data attributes instead of inline event handlers.

@snoopdave snoopdave left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of 3812728dd: Reviewed the full diff and compared it with #318. The differences are explained by the 6.1.x branch; I found no actionable defects. No build was run under the review constraints.

No issues found.

@mraible
mraible requested a review from snoopdave November 18, 2026 03:21

@snoopdave snoopdave left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

@mraible
mraible merged commit 2f52062 into roller-6.1.x Nov 18, 2026
7 checks passed
@mraible
mraible deleted the escape-user-display-names-6.1.x branch November 18, 2026 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants