From 2cdd5a494010b8a8e7a73774a4e3a1b4d5611ca0 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 17 Mar 2019 22:13:17 +0000 Subject: [PATCH] Fixes errors/notices --- src/Protocol/ActivityPub/Processor.php | 8 ++++++-- view/theme/frio/php/default.php | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index c38cba28f1..475ccfc0b2 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -48,7 +48,7 @@ class Processor * * @return string with replaced emojis */ - public static function replaceEmojis($body, array $emojis) + private static function replaceEmojis($body, array $emojis) { foreach ($emojis as $emoji) { $replace = '[class=emoji mastodon][img=' . $emoji['href'] . ']' . $emoji['name'] . '[/img][/class]'; @@ -263,7 +263,11 @@ class Processor $item['body'] = $activity['source']; } else { $content = HTML::toBBCode($activity['content']); - $content = self::replaceEmojis($content, $activity['emojis']); + + if (!empty($activity['emojis'])) { + $content = self::replaceEmojis($content, $activity['emojis']); + } + $content = self::convertMentions($content); if (($item['thr-parent'] != $item['uri']) && ($item['gravity'] == GRAVITY_COMMENT)) { diff --git a/view/theme/frio/php/default.php b/view/theme/frio/php/default.php index 29d7ab53c1..5eeb14c75f 100644 --- a/view/theme/frio/php/default.php +++ b/view/theme/frio/php/default.php @@ -53,7 +53,7 @@ $is_singleuser_class = $is_singleuser ? "is-singleuser" : "is-not-singleuser"; $nav_bg = PConfig::get($uid, 'frio', 'nav_bg'); } - if (empty($nav_bg)) { + if (empty($nav_bg) || !is_string($nav_bg)) { $nav_bg = "#708fa0"; } -- 2.39.5