Repository navigation
Fix RSS item titles to actually use only the commit message's first line - #244
Merged
Merged
Conversation
$title = trim(explode('\n', $r->msg)[0]) intended to take just the
first line of the commit message, but '\n' in a single-quoted PHP
string is the literal two-character sequence backslash-n, not a
newline escape -- explode() never matched anything, so it always
returned the entire message as a single element. Every RSS item title
was built from the full, possibly multi-line commit message, not just
its first line.
This also meant the 10-word truncation a few lines below was applied
across the whole message rather than the first line alone, so the
"..." suffix appeared on nearly every multi-line commit regardless of
how short its actual first line was.
Use preg_split() on an actual newline (with optional preceding \r) to
split correctly, matching the fix already applied to the analogous
issue in blame.php.
michael-o
force-pushed
the
fix-rss-title-first-line
branch
from
September 10, 2026 15:43
075830b to
0feb818
Compare
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.
$title = trim(explode('\n', $r->msg)[0]) intended to take just the first line of the commit message, but '\n' in a single-quoted PHP string is the literal two-character sequence backslash-n, not a newline escape -- explode() never matched anything, so it always returned the entire message as a single element. Every RSS item title was built from the full, possibly multi-line commit message, not just its first line.
This also meant the 10-word truncation a few lines below was applied across the whole message rather than the first line alone, so the "..." suffix appeared on nearly every multi-line commit regardless of how short its actual first line was.
Use preg_split() on an actual newline (with optional preceding \r) to split correctly, matching the fix already applied to the analogous issue in blame.php.