Format content for push notifications - refs BT#15928

pull/2981/head
Angel Fernando Quiroz Campos 7 years ago
parent 8f97c374f5
commit e8bc411a5a
  1. 8
      main/inc/lib/notification.lib.php

@ -489,9 +489,11 @@ class Notification extends Model
return false;
}
$content = str_replace(['<br>', '<br/>', '<br />'], "\n", $content);
$content = strip_tags($content);
$content = html_entity_decode($content, ENT_QUOTES);
$content = explode("\n", $content);
$content = array_map('trim', $content);
$content = array_filter($content);
$content = implode(PHP_EOL, $content);
$gcmRegistrationIds = [];
foreach ($userIds as $userId) {
@ -527,7 +529,7 @@ class Notification extends Model
'title' => $title,
'body' => $content,
],
'collapse_key' => 'Messages',
'collapse_key' => get_lang('Messages'),
'sound' => true,
]);

Loading…
Cancel
Save