From 91707a530c52e550d2320ff00f02efaaffc15853 Mon Sep 17 00:00:00 2001 From: nupplaPhil Date: Tue, 28 Jan 2020 22:26:23 +0100 Subject: [PATCH] Add default values for inserts --- include/enotify.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/include/enotify.php b/include/enotify.php index a1dbf77b65..7567613b4f 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -483,17 +483,17 @@ function notification($params) if ($show_in_notification_page) { $notification = DI::notify()->insert([ - 'name' => $params['source_name'], - 'name_cache' => strip_tags(BBCode::convert($params['source_name'])), - 'url' => $params['source_link'], - 'photo' => $params['source_photo'], - 'link' => $itemlink, - 'uid' => $params['uid'], - 'iid' => $item_id, - 'parent' => $parent_id, - 'type' => $params['type'], - 'verb' => $params['verb'], - 'otype' => $params['otype'], + 'name' => $params['source_name'] ?? '', + 'name_cache' => strip_tags(BBCode::convert($params['source_name'] ?? '')), + 'url' => $params['source_link'] ?? '', + 'photo' => $params['source_photo'] ?? '', + 'link' => $itemlink ?? '', + 'uid' => $params['uid'] ?? 0, + 'iid' => $item_id ?? 0, + 'parent' => $parent_id ?? 0, + 'type' => $params['type'] ?? '', + 'verb' => $params['verb'] ?? '', + 'otype' => $params['otype'] ?? '', ]); $notification->msg = Renderer::replaceMacros($epreamble, ['$itemlink' => $notification->link]);