1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +02:00

[ticket/17343] Display push notifications in user language

PHPBB-17343
This commit is contained in:
Marc Alexander
2024-07-17 21:52:14 +02:00
parent 94112979a0
commit 767d9e1198
3 changed files with 52 additions and 13 deletions

View File

@@ -140,13 +140,7 @@ class webpush extends messenger_base implements extended_method_interface
{
$data = $notification->get_insert_array();
$data += [
'push_data' => json_encode([
'heading' => $this->config['sitename'],
'title' => strip_tags($notification->get_title()),
'text' => strip_tags($notification->get_reference()),
'url' => htmlspecialchars_decode($notification->get_url()),
'avatar' => $notification->get_avatar(),
]),
'push_data' => json_encode(array_merge($notification->get_insert_array(), ['notification_type_name' => $notification->get_type()])),
'notification_time' => time(),
'push_token' => hash('sha256', random_bytes(32))
];