Skip to content

Commit 7fb9e6d

Browse files
authored
Use regex
1 parent f4168a4 commit 7fb9e6d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Notifier/Bridge/Slack/SlackTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ final class SlackTransport extends AbstractTransport
3636

3737
public function __construct(string $accessToken, string $channel = null, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)
3838
{
39-
if (!\in_array(substr($accessToken, 0, 5), ['xoxb-', 'xoxp-'], true) && 0 !== strpos($accessToken, 'xoxa-2')) {
39+
if (!preg_match('/^xox(b-|p-|a-2)/', $accessToken)) {
4040
throw new InvalidArgumentException('A valid Slack token needs to start with "xoxb-", "xoxp-" or "xoxa-2". See https://api.slack.com/authentication/token-types for further information.');
4141
}
4242

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy