Skip to content

Commit 242e3ca

Browse files
committed
Re-visit decoding emojis
Signed-off-by: Matt Friedman <maf675@gmail.com>
1 parent 0760621 commit 242e3ca

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

ucp/controller/webpush.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,9 @@ public function notification(): JsonResponse
123123

124124
$notification_data = $this->get_user_notifications();
125125

126-
// Decode and return data if everything is fine; update url paths and decode message emoji
126+
// Decode and return data if everything is fine
127127
$data = json_decode($notification_data, true);
128128
$data['url'] = isset($data['url']) ? $this->path_helper->update_web_root_path($data['url']) : '';
129-
$data['text'] = isset($data['text']) ? html_entity_decode($data['text'], ENT_NOQUOTES, 'UTF-8') : '';
130129

131130
return new JsonResponse($data);
132131
}
@@ -234,8 +233,8 @@ private function get_notification_data(string $notification_data): string
234233

235234
return json_encode([
236235
'heading' => $this->config['sitename'],
237-
'title' => strip_tags($notification->get_title()),
238-
'text' => strip_tags($notification->get_reference()),
236+
'title' => strip_tags(html_entity_decode($notification->get_title(), ENT_NOQUOTES, 'UTF-8')),
237+
'text' => strip_tags(html_entity_decode($notification->get_reference(), ENT_NOQUOTES, 'UTF-8')),
239238
'url' => htmlspecialchars_decode($notification->get_url()),
240239
'avatar' => $notification->get_avatar(),
241240
]);

0 commit comments

Comments
 (0)