From a6f6c1b1756f197acc6bfec02ef6758c4b363129 Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Sat, 11 May 2024 06:57:56 +1000 Subject: [PATCH 1/3] "Something happened". --- include/conversation.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/conversation.php b/include/conversation.php index 048754823..527975708 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -938,6 +938,9 @@ function builtin_activity_puller($item, &$conv_responses) foreach ($conv_responses as $mode => $v) { $url = ''; + if (!$item['author']['xchan_name']) { + continue; + } switch ($mode) { case 'like': $verb = ACTIVITY_LIKE; @@ -962,7 +965,7 @@ function builtin_activity_puller($item, &$conv_responses) } if ((activity_match($item['verb'], $verb)) && ($item['id'] != $item['parent'])) { - $name = (($item['author']['xchan_name']) ? $item['author']['xchan_name'] : t('Unknown')); + $name = $item['author']['xchan_name']; $url = (($item['author_xchan'] && $item['author']['xchan_photo_s']) ? '' . '' . urlencode($name) . ' ' . $name . ' (' . relative_date($item['received']) .')' : '' . $name . ' (' . relative_date($item['received']) . ')' From 75461516c967edec37f2071837f2376b86475531 Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Sat, 11 May 2024 07:42:03 +1000 Subject: [PATCH 2/3] log the anomaly --- include/conversation.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/conversation.php b/include/conversation.php index 527975708..34da33dfa 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -939,6 +939,8 @@ function builtin_activity_puller($item, &$conv_responses) $url = ''; if (!$item['author']['xchan_name']) { + logger('Unidentified author for item: ' . $item['id']); + logger('Unidentified item: ' . print_r($item,true), LOGGER_DATA); continue; } switch ($mode) { @@ -965,7 +967,7 @@ function builtin_activity_puller($item, &$conv_responses) } if ((activity_match($item['verb'], $verb)) && ($item['id'] != $item['parent'])) { - $name = $item['author']['xchan_name']; + $name = $item['author']['xchan_name'] ?: t('Unknown'); $url = (($item['author_xchan'] && $item['author']['xchan_photo_s']) ? '' . '' . urlencode($name) . ' ' . $name . ' (' . relative_date($item['received']) .')' : '' . $name . ' (' . relative_date($item['received']) . ')' From ba97646c52519969a281957272345f3db154f619 Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Sat, 11 May 2024 08:22:39 +1000 Subject: [PATCH 3/3] normalise line endings on profile edit --- src/Module/Settings/Profile_edit.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Module/Settings/Profile_edit.php b/src/Module/Settings/Profile_edit.php index 03b2435c9..3daef07a7 100644 --- a/src/Module/Settings/Profile_edit.php +++ b/src/Module/Settings/Profile_edit.php @@ -140,6 +140,11 @@ class Profile_edit } } + // Normalise any line endings encountered from input. + foreach ($_POST as $key => $value) { + $_POST[$key] = str_replace("\r\n", "\n", $value); + } + $name = escape_tags(trim($_POST['name'])); if ($orig[0]['fullname'] != $name) {