Skip to content

Commit 6d7df60

Browse files
committed
[BUGFIX] Remove interpolation braces from Slack footer link
f055d02 moved the source URL into a constant and turned the footer into a sprintf() format. The braces around the placeholder are PHP interpolation syntax and only vanish inside a double quoted string, so Slack now receives `<{https://…/SlackService.php}|(?)>` and prints that verbatim instead of the "(?)" link. The existing footer assertions match substrings and pass on the broken markup, so the test additionally requires every link target in the text and in the footer to be a bare URL. Assisted-by: claude-code:claude-opus-5 Agent-Session: https://claude.ai/code/session_014H1xwaAmrQRWUA3vx8bJcD Agent-Host: 0493f0 Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
1 parent 64ab28a commit 6d7df60

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/Service/SlackService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function sendRepositoryDiscoveryMessage(DocumentationJar $jar): ResponseI
6262
. ":hammer_and_wrench: *Maintainers:* <{$deploymentsUrl}|Review pending deployments>\n"
6363
. ":information_source: *Extension authors:* <{$webhookDocsUrl}|How does this work?>",
6464
'fallback' => "Repository {$repoKey} is awaiting documentation approval at {$deploymentsUrl}",
65-
'footer' => sprintf("TYPO3 Intercept \u{00b7} <{%s}|(?)>", self::SOURCE_URL),
65+
'footer' => sprintf("TYPO3 Intercept \u{00b7} <%s|(?)>", self::SOURCE_URL),
6666
'footer_icon' => self::AVATAR_URL,
6767
'mrkdwn_in' => ['text'],
6868
],

tests/Functional/Service/SlackServiceTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,15 @@ public function testSendRepositoryDiscoveryMessageContainsExpectedPayload(): voi
8888
self::assertStringContainsString('github.com/TYPO3GmbH/site-intercept', $attachment['footer']);
8989
self::assertStringContainsString('SlackService.php', $attachment['footer']);
9090

91+
// Every link target must be a bare URL, `<{https://…}|label>` is rendered verbatim by Slack
92+
foreach (['text', 'footer'] as $field) {
93+
preg_match_all('/<([^|>]*)\|[^>]*>/', $attachment[$field], $links);
94+
self::assertNotEmpty($links[1], sprintf('No Slack link found in attachment field "%s"', $field));
95+
foreach ($links[1] as $target) {
96+
self::assertMatchesRegularExpression('#^https?://\S+$#', $target);
97+
}
98+
}
99+
91100
// Must opt into mrkdwn rendering for the text field
92101
self::assertContains('text', $attachment['mrkdwn_in']);
93102
}

0 commit comments

Comments
 (0)