Skip to content

Commit 76b8f31

Browse files
committed
Fix subvscription expiration type
Signed-off-by: Matt Friedman <maf675@gmail.com>
1 parent 1972c51 commit 76b8f31

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

notification/method/webpush.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ public function get_ucp_template_data(helper $controller_helper, form_helper $fo
371371
{
372372
$subscriptions[] = [
373373
'endpoint' => $subscription['endpoint'],
374-
'expirationTime' => $subscription['expiration_time'],
374+
'expirationTime' => (int) $subscription['expiration_time'],
375375
];
376376
}
377377
}

tests/event/listener_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public function get_ucp_template_data_data()
188188
'method_data' => [
189189
'id' => 'notification.method.phpbb.wpn.webpush',
190190
],
191-
[['endpoint' => 'https://web.push.test.localhost/foo2', 'expirationTime' => '0']],
191+
[['endpoint' => 'https://web.push.test.localhost/foo2', 'expirationTime' => 0]],
192192
true,
193193
],
194194
[ // wrong method, but with a valid webpush subscription, expect no code execution
@@ -204,7 +204,7 @@ public function get_ucp_template_data_data()
204204
'method_data' => [
205205
'id' => 'notification.method.phpbb.wpn.webpush',
206206
],
207-
[['endpoint' => 'https://web.push.test.localhost/foo3', 'expirationTime' => '1']],
207+
[['endpoint' => 'https://web.push.test.localhost/foo3', 'expirationTime' => 1]],
208208
true,
209209
],
210210
[ // webpush method with an invalid webpush subscription, expect code execution but no subscription data

0 commit comments

Comments
 (0)