aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r--Zotlabs/Lib/Activity.php8
-rw-r--r--Zotlabs/Lib/Enotify.php6
2 files changed, 7 insertions, 7 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index d80394c7b..8380e2287 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -1600,9 +1600,9 @@ class Activity {
// we already store this in Activity::fetch()
// XConfig::Set($url, 'system', 'actor_record', $person_obj);
- $name = $person_obj['name'];
+ $name = $person_obj['name'] ?? '';
if (!$name) {
- $name = $person_obj['preferredUsername'];
+ $name = $person_obj['preferredUsername'] ?? '';
}
if (!$name) {
$name = t('Unknown');
@@ -1644,7 +1644,7 @@ class Activity {
$links = false;
$profile = false;
- if (is_array($person_obj['url'])) {
+ if (isset($person_obj['url']) && is_array($person_obj['url'])) {
if (!array_key_exists(0, $person_obj['url'])) {
$links = [$person_obj['url']];
}
@@ -1653,7 +1653,7 @@ class Activity {
}
}
- if ($links) {
+ if (is_array($links) && $links) {
foreach ($links as $link) {
if (is_array($link) && array_key_exists('mediaType', $link) && $link['mediaType'] === 'text/html') {
$profile = $link['href'];
diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php
index 5a09ade90..513f4ae14 100644
--- a/Zotlabs/Lib/Enotify.php
+++ b/Zotlabs/Lib/Enotify.php
@@ -499,6 +499,7 @@ class Enotify {
$datarray['verb'] = $params['verb'];
$datarray['otype'] = $params['otype'];
$datarray['abort'] = false;
+ $datarray['seen'] = 0;
$datarray['item'] = $params['item'];
@@ -511,7 +512,6 @@ class Enotify {
// create notification entry in DB
- $seen = 0;
// Mark some notifications as seen right away
// Note! The notification have to be created, because they are used to send emails
@@ -521,7 +521,7 @@ class Enotify {
if (!$always_show_in_notices) {
if (($params['type'] === NOTIFY_WALL) || ($params['type'] === NOTIFY_MAIL) || ($params['type'] === NOTIFY_INTRO)) {
- $seen = 1;
+ $datarray['seen'] = 1;
}
}
@@ -537,7 +537,7 @@ class Enotify {
intval($datarray['uid']),
dbesc($datarray['link']),
dbesc($datarray['parent']),
- intval($seen),
+ intval($datarray['seen']),
intval($datarray['ntype']),
dbesc($datarray['verb']),
dbesc($datarray['otype'])