From: Michael Date: Mon, 5 Jul 2021 20:20:39 +0000 (+0000) Subject: Remove attachment on plaintext conversion X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=db90e3bf2527755d4a14186e771d63e8822355b1;p=friendica.git Remove attachment on plaintext conversion --- diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index b1244d0ac3..8eef487041 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -437,6 +437,9 @@ class BBCode $text = preg_replace("/\[img\=(.*?)\](.*?)\[\/img\]/ism", ' $2 ', $text); $text = preg_replace("/\[img.*?\[\/img\]/ism", ' ', $text); + // Remove attachment + $text = self::removeAttachment($text); + $naked_text = HTML::toPlaintext(self::convert($text, false, 0, true), 0, !$keep_urls); return $naked_text; @@ -958,7 +961,7 @@ class BBCode public static function fetchShareAttributes($text) { // See Issue https://github.com/friendica/friendica/issues/10454 - // Hashtags in usernames are expanded to links. This here is a quick fix. + // Hashtags in usernames are expanded to links. This here is a quick fix. $text = preg_replace('/([@!#])\[url\=.*?\](.*?)\[\/url\]/ism', '$1$2', $text); $attributes = []; @@ -2130,8 +2133,8 @@ class BBCode /** * Expand tags to URLs * - * @param string $body - * @return string body with expanded tags + * @param string $body + * @return string body with expanded tags */ public static function expandTags(string $body) {