Skip to content

Fix RSS item titles to actually use only the commit message's first line - #244

Merged
michael-o merged 1 commit into
masterfrom
fix-rss-title-first-line
Sep 10, 2026
Merged

michael-o merged 1 commit into
masterfrom
fix-rss-title-first-line

Conversation

@michael-o

Copy link
Copy Markdown
Member

$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 michael-o self-assigned this Sep 2, 2026
@michael-o michael-o added this to the 2.9.0 milestone Sep 2, 2026
$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
michael-o force-pushed the fix-rss-title-first-line branch from 075830b to 0feb818 Compare September 10, 2026 15:43
@michael-o
michael-o merged commit 0feb818 into master Sep 10, 2026
@michael-o
michael-o deleted the fix-rss-title-first-line branch September 10, 2026 15:43
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.

1 participant