X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fbbcode.php;h=9a43cdb305e140222650bcfdd9dd97f307da934b;hb=8abdbb799a44795bf53a558f29b495147d88c04f;hp=5a066596e6d1f6e57f4cad5a807610e134cdef62;hpb=e16fb74b0c0198731d037fb3cf27949b20971e6e;p=friendica.git diff --git a/include/bbcode.php b/include/bbcode.php index 5a066596e6..9a43cdb305 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -1,5 +1,7 @@ ' . generate_map(str_replace('/',' ',$match[1])) . '', $match[0]); + return str_replace($match[0], '
' . generate_map(str_replace('/', ' ', $match[1])) . '
', $match[0]); } function bb_map_location($match) { // the extra space in the following line is intentional - return str_replace($match[0],'
' . generate_named_map($match[1]) . '
', $match[0]); + return str_replace($match[0], '
' . generate_named_map($match[1]) . '
', $match[0]); } function bb_attachment($Text, $simplehtml = false, $tryoembed = true) { $data = get_attachment_data($Text); - if (!$data) + if (!$data) { return $Text; + } if (isset($data["title"])) { $data["title"] = strip_tags($data["title"]); @@ -50,43 +55,37 @@ function bb_attachment($Text, $simplehtml = false, $tryoembed = true) { } if ($simplehtml == 7) { - $title2 = $data["title"]; - - $test1 = trim(html_entity_decode($data["text"],ENT_QUOTES,'UTF-8')); - $test2 = trim(html_entity_decode($data["title"],ENT_QUOTES,'UTF-8')); - - // If the link description is similar to the text above then don't add the link description - if (($data["title"] != "") AND ((strpos($test1,$test2) !== false) OR - (similar_text($test1,$test2) / strlen($data["title"])) > 0.9)) - $title2 = $data["url"]; - $text = sprintf('%s
', - $data["url"], $data["title"], $title2); + $text = style_url_for_mastodon($data["url"]); } elseif (($simplehtml != 4) AND ($simplehtml != 0)) { $text = sprintf('%s
', $data["url"], $data["title"]); } else { $text = sprintf('', $data["type"]); $bookmark = array(sprintf('[bookmark=%s]%s[/bookmark]', $data["url"], $data["title"]), $data["url"], $data["title"]); - if ($tryoembed) + if ($tryoembed) { $oembed = tryoembed($bookmark); - else + } else { $oembed = $bookmark[0]; + } - if (strstr(strtolower($oembed), "