Skip to content

Commit a14a3b7

Browse files
committed
Add try/catch to endpoint padding
Signed-off-by: Matt Friedman <maf675@gmail.com>
1 parent 3b5ee9c commit a14a3b7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

notification/method/webpush.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,13 +495,19 @@ protected function get_board_url()
495495
* @param string $endpoint
496496
*
497497
* @return void
498-
* @throws \Exception
499498
*/
500499
protected function set_endpoint_padding(\Minishlink\WebPush\WebPush $web_push, string $endpoint): void
501500
{
502501
if (strpos($endpoint, 'mozilla.com') || strpos($endpoint, 'mozaws.net'))
503502
{
504-
$web_push->setAutomaticPadding(self::MOZILLA_FALLBACK_PADDING);
503+
try
504+
{
505+
$web_push->setAutomaticPadding(self::MOZILLA_FALLBACK_PADDING);
506+
}
507+
catch (\Exception $e)
508+
{
509+
// This shouldn't happen since we won't pass padding length outside limits
510+
}
505511
}
506512
}
507513
}

0 commit comments

Comments
 (0)