]> git.mxchange.org Git - friendica.git/commitdiff
Pleroma with the Mastodon UI handles content warning different
authorMichael <heluecht@pirati.ca>
Tue, 13 Mar 2018 21:58:05 +0000 (21:58 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 13 Mar 2018 21:58:05 +0000 (21:58 +0000)
src/Protocol/OStatus.php

index aad97c80ff57ed687c5ca929c7fdbaba48513f2a..aa1079407af6a6896c55d6d50735fcf8b2284ff5 100644 (file)
@@ -660,8 +660,9 @@ class OStatus
                // Mastodon Content Warning
                if (($item["verb"] == ACTIVITY_POST) && $xpath->evaluate('boolean(atom:summary)', $entry)) {
                        $clear_text = $xpath->query('atom:summary/text()', $entry)->item(0)->nodeValue;
-
-                       $item["body"] = html2bbcode($clear_text) . '[spoiler]' . $item["body"] . '[/spoiler]';
+                       if (!empty($clear_text)) {
+                               $item["body"] = html2bbcode($clear_text) . '[spoiler]' . $item["body"] . '[/spoiler]';
+                       }
                }
 
                if (($self != '') && empty($item['protocol'])) {