[ticket/17330] Add try/catch block though it's not really needed

PHPBB-17330
This commit is contained in:
Marc Alexander 2024-06-06 20:21:39 +02:00
parent e813bd02c6
commit 35436f078c
No known key found for this signature in database
GPG key ID: 50E0D2423696F995

View file

@ -442,13 +442,19 @@ class webpush extends messenger_base implements extended_method_interface
* @param string $endpoint
*
* @return void
* @throws \Exception
*/
protected function set_endpoint_padding(\Minishlink\WebPush\WebPush $web_push, string $endpoint): void
{
if (str_contains($endpoint, 'mozilla.com') || str_contains($endpoint, 'mozaws.net'))
{
$web_push->setAutomaticPadding(self::MOZILLA_FALLBACK_PADDING);
try
{
$web_push->setAutomaticPadding(self::MOZILLA_FALLBACK_PADDING);
}
catch (\Exception)
{
// This shouldn't happen since we won't pass padding length outside limits
}
}
}
}