]> git.mxchange.org Git - friendica.git/commitdiff
Put the title in the body
authorMichael <heluecht@pirati.ca>
Wed, 4 Dec 2019 23:49:07 +0000 (23:49 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 4 Dec 2019 23:49:07 +0000 (23:49 +0000)
src/Model/Item.php

index 1faee3bdcc1cdd915ea3c438000bce9e88c0418d..5309a898bc9695dd90157479791981e469317865 100644 (file)
@@ -3821,7 +3821,15 @@ class Item extends BaseObject
                                return $item;
                        }
                }
-               $item['body'] = preg_replace("/(.*?\[share.*?\]\s?).*?(\s?\[\/share\]\s?)/ism", '$1' . $shared_item['body'] . '$2', $item['body']);
+
+               if (!empty($shared_item['title'])) {
+                       $body = '[h3]' . $shared_item['title'] . "[/h3]\n" . $shared_item['body'];
+                       unset($shared_item['title']);
+               } else {
+                       $body = $shared_item['body'];
+               }
+
+               $item['body'] = preg_replace("/(.*?\[share.*?\]\s?).*?(\s?\[\/share\]\s?)/ism", '$1' . $body . '$2', $item['body']);
                unset($shared_item['body']);
 
                return array_merge($item, $shared_item);