]> git.mxchange.org Git - friendica.git/commitdiff
Fixes errors/notices
authorMichael <heluecht@pirati.ca>
Sun, 17 Mar 2019 22:13:17 +0000 (22:13 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 17 Mar 2019 22:13:17 +0000 (22:13 +0000)
src/Protocol/ActivityPub/Processor.php
view/theme/frio/php/default.php

index c38cba28f187419258727c62693323538b5edc03..475ccfc0b22048f66a4aa1b6b43c3b547a380530 100644 (file)
@@ -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)) {
index 29d7ab53c1c4e4a78ffbfc06f8bd85a467f100ad..5eeb14c75f4512373a3abd31cf3b56f02306f7c6 100644 (file)
@@ -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";
                }