]> git.mxchange.org Git - friendica.git/commitdiff
Add default values for inserts
authornupplaPhil <admin@philipp.info>
Tue, 28 Jan 2020 21:26:23 +0000 (22:26 +0100)
committernupplaPhil <admin@philipp.info>
Tue, 28 Jan 2020 21:26:23 +0000 (22:26 +0100)
include/enotify.php

index a1dbf77b65a8eadbb95547ceafef8427cc6f21a0..7567613b4fb17cdbe651559c39029c0c7e24c82b 100644 (file)
@@ -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]);