mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
[ticket/17010] Properly handle expired subscriptions and extend tests
PHPBB3-17010
This commit is contained in:
@@ -253,7 +253,7 @@ class webpush extends messenger_base implements extended_method_interface
|
||||
// Fill array of endpoints to remove if subscription has expired
|
||||
if ($report->isSubscriptionExpired())
|
||||
{
|
||||
$expired_endpoints = $report->getEndpoint();
|
||||
$expired_endpoints[] = $report->getEndpoint();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -415,11 +415,14 @@ class webpush extends messenger_base implements extended_method_interface
|
||||
$remove_subscriptions = [];
|
||||
foreach ($expired_endpoints as $endpoint)
|
||||
{
|
||||
foreach ($user_subscription_map as $user_id => $subscriptions)
|
||||
foreach ($user_subscription_map as $subscriptions)
|
||||
{
|
||||
if (isset($subscriptions['endpoint']) && $subscriptions['endpoint'] == $endpoint)
|
||||
foreach ($subscriptions as $subscription)
|
||||
{
|
||||
$remove_subscriptions[] = $subscriptions[$endpoint]['subscription_id'];
|
||||
if (isset($subscription['endpoint']) && $subscription['endpoint'] == $endpoint)
|
||||
{
|
||||
$remove_subscriptions[] = $subscription['subscription_id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user