Repository navigation
Show comment and media file authors once-escaped in feeds and keep existing rel values in addNofollow - #347
Merged
Conversation
…isting rel values in addNofollow The comment feed macros and the media file feed now turn author names back into text with unescapeHTML before XML-escaping them, as the entry author macros do, so a name like "A & B" no longer shows as "A & B" in feed readers. FeedAuthorEscapingTest covers the Atom and RSS comment feeds and the media file feed. Utilities.addNofollow adds nofollow to a link's existing rel value instead of adding a second rel attribute, and a ">" inside a quoted attribute value no longer ends the link early. The linear-time test now allows 2 seconds so it doesn't fail on slow build machines.
snoopdave
reviewed
Nov 18, 2026
addNofollow looked for rel= anywhere in the tag, so a link like <a href="/x" title='foo rel=external' rel="noopener"> had nofollow added to the title text while its real rel stayed followable. It now walks the tag's attributes while tracking quotes, the same way findTagEnd finds the end of the tag, and changes only a real rel attribute. A rel with no value gets rel="nofollow".
…low on links with odd quoting A comment saved without a name, or a media file whose creator can't be found, made the comment and media file feeds print the template expression itself as the author, because unescapeHTML passed null through and Velocity prints a null reference as its source text. The template unescapeHTML helper now returns an empty string for null, as removeHTML does, so the author element is empty again. addNofollow treated a quote anywhere after an equals sign as the start of a quoted value, so a quote inside an unquoted value could hide the end of the tag and leave that link and the next one without nofollow. A quote now only opens a value as its first character. When a quote never closes, the link ends at the next > as it did before the quote-aware scan, so later links still get nofollow, and a rel value with no closing quote gets one so the output stays well formed.
snoopdave
reviewed
Nov 20, 2026
snoopdave
left a comment
Contributor
There was a problem hiding this comment.
Review of c262a6233: Comment and media file authors in the feeds are unescaped and then XML-escaped once, matching the entry author macros, and addNofollow now extends an existing rel value and skips > inside quoted values. The attribute walk always advances, so it cannot loop, and the new tests cover the rel and quoting cases.
No new issues found.
snoopdave
approved these changes
Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows up #330 from review, with the same change as the new commit on #318.
unescapeHTMLbefore XML-escaping them, as the entry author macros do, so a name likeA & Bno longer shows asA & Bin feed readers.Utilities.addNofollowaddsnofollowto a link's existingrelvalue instead of adding a secondrelattribute, and a>inside a quoted attribute value no longer ends the link early.Tests:
FeedAuthorEscapingTestcovers the Atom and RSS comment feeds and the media file feed, andUtilitiesTesthas newaddNofollowcases. The linear-time test now allows 2 seconds so it doesn't fail on slow build machines.A further review pass added these fixes:
addNofollowadds nofollow to links with a quote inside an unquoted attribute value or a quote that never closes, and to the links after them.