]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Post/Media.php
Improved handling of native quotes
[friendica.git] / src / Model / Post / Media.php
index 6d0707743eed1876d09a2f9bf9b76b0e92dfe9ee..478097effa80d06c278da05ba7e1a40ae13ea734 100644 (file)
@@ -403,12 +403,6 @@ class Media
                // Simplify image codes
                $unshared_body = $body = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '[img]$3[/img]', $body);
 
-               // Only remove the shared data from "real" reshares
-               $shared = BBCode::fetchShareAttributes($body);
-               if (!empty($shared['guid'])) {
-                       $unshared_body = preg_replace("/\s*\[share .*?\].*?\[\/share\]\s*/ism", '', $body);
-               }
-
                $attachments = [];
                if (preg_match_all("#\[url=([^\]]+?)\]\s*\[img=([^\[\]]*)\]([^\[\]]*)\[\/img\]\s*\[/url\]#ism", $body, $pictures, PREG_SET_ORDER)) {
                        foreach ($pictures as $picture) {
@@ -485,13 +479,6 @@ class Media
         */
        public static function insertFromRelevantUrl(int $uriid, string $body)
        {
-               // Only remove the shared data from "real" reshares
-               $shared = BBCode::fetchShareAttributes($body);
-               if (!empty($shared['guid'])) {
-                       // Don't look at the shared content
-                       $body = preg_replace("/\s*\[share .*?\].*?\[\/share\]\s*/ism", '', $body);
-               }
-
                // Remove all hashtags and mentions
                $body = preg_replace("/([#@!])\[url\=(.*?)\](.*?)\[\/url\]/ism", '', $body);
 
@@ -521,9 +508,6 @@ class Media
         */
        public static function insertFromAttachmentData(int $uriid, string $body)
        {
-               // Don't look at the shared content
-               $body = preg_replace("/\s*\[share .*?\].*?\[\/share\]\s*/ism", '', $body);
-
                $data = BBCode::getAttachmentData($body);
                if (empty($data))  {
                        return;