From 39d035ea8e7ae41d3cf0ef097ec3657d1401627d Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Mon, 24 Aug 2026 13:48:05 +0200 Subject: [PATCH] [BUGFIX] Remove interpolation braces from Slack footer link MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/Service/SlackService.php | 2 +- tests/Functional/Service/SlackServiceTest.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Service/SlackService.php b/src/Service/SlackService.php index e9b8fbd..8603904 100644 --- a/src/Service/SlackService.php +++ b/src/Service/SlackService.php @@ -63,7 +63,7 @@ public function sendRepositoryDiscoveryMessage(DocumentationJar $jar): ResponseI . ":hammer_and_wrench: *Maintainers:* <{$deploymentsUrl}|Review pending deployments> | <{$gitUrl}|:git:>\n" . ":information_source: *Extension authors:* <{$webhookDocsUrl}|How does this work?>", 'fallback' => "Repository {$repoKey} is awaiting documentation approval at {$deploymentsUrl}", - 'footer' => sprintf("TYPO3 Intercept \u{00b7} <{%s}|(?)>", self::SOURCE_URL), + 'footer' => sprintf("TYPO3 Intercept \u{00b7} <%s|(?)>", self::SOURCE_URL), 'footer_icon' => self::AVATAR_URL, 'mrkdwn_in' => ['text'], ], diff --git a/tests/Functional/Service/SlackServiceTest.php b/tests/Functional/Service/SlackServiceTest.php index 20913c2..d7bc739 100644 --- a/tests/Functional/Service/SlackServiceTest.php +++ b/tests/Functional/Service/SlackServiceTest.php @@ -89,6 +89,15 @@ public function testSendRepositoryDiscoveryMessageContainsExpectedPayload(): voi self::assertStringContainsString('github.com/TYPO3GmbH/site-intercept', $attachment['footer']); self::assertStringContainsString('SlackService.php', $attachment['footer']); + // Every link target must be a bare URL, `<{https://…}|label>` is rendered verbatim by Slack + foreach (['text', 'footer'] as $field) { + preg_match_all('/<([^|>]*)\|[^>]*>/', $attachment[$field], $links); + self::assertNotEmpty($links[1], sprintf('No Slack link found in attachment field "%s"', $field)); + foreach ($links[1] as $target) { + self::assertMatchesRegularExpression('#^https?://\S+$#', $target); + } + } + // Must opt into mrkdwn rendering for the text field self::assertContains('text', $attachment['mrkdwn_in']);