if ($show_in_notification_page) {
$notification = DI::notify()->insert([
'name' => $params['source_name'] ?? '',
- 'name_cache' => substr(strip_tags(BBCode::convert($params['source_name'] ?? '')), 0, 255),
+ 'name_cache' => substr(strip_tags(BBCode::convert($params['source_name'])), 0, 255),
'url' => $params['source_link'] ?? '',
'photo' => $params['source_photo'] ?? '',
'link' => $itemlink ?? '',
'otype' => $params['otype'] ?? '',
]);
+ // Notification insertion can be intercepted by an addon registering the 'enotify_store' hook
+ if (!$notification) {
+ return false;
+ }
+
$notification->msg = Renderer::replaceMacros($epreamble, ['$itemlink' => $notification->link]);
DI::notify()->update($notification);