X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fbbcode.php;h=81536d37200fdd5083a38685c306282856f8d0cb;hb=b609aca456c498e1db2952ff6b9c9116037dae03;hp=c08c6d4d95682e83e5691e5587cf21603d8b8147;hpb=8490bedefe14400c0b7175a3775e3bb18139479a;p=friendica.git diff --git a/include/bbcode.php b/include/bbcode.php index c08c6d4d95..81536d3720 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -1,10 +1,37 @@ ' . 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]); +} + +function bb_attachment($Text, $simplehtml = false, $tryoembed = true) { $Text = preg_replace_callback("/(.*?)\[attachment(.*?)\](.*?)\[\/attachment\]/ism", - function ($match) use ($plaintext){ + function ($match) use ($simplehtml, $tryoembed){ $attributes = $match[2]; @@ -42,7 +69,7 @@ function bb_attachment($Text, $plaintext = false, $tryoembed = true) { $title = $matches[1]; //$title = htmlentities($title, ENT_QUOTES, 'UTF-8', false); - $title = bbcode(html_entity_decode($title), false, false, true); + $title = bbcode(html_entity_decode($title, ENT_QUOTES, 'UTF-8'), false, false, true); $title = str_replace(array("[", "]"), array("[", "]"), $title); $image = ""; @@ -72,7 +99,10 @@ function bb_attachment($Text, $plaintext = false, $tryoembed = true) { $image = ""; } - if ($plaintext) + if ($simplehtml == 7) + $text = sprintf('%s', + $url, $title, $title); + elseif (($simplehtml != 4) AND ($simplehtml != 0)) $text = sprintf('%s
', $url, $title); else { $text = sprintf('', $type); @@ -83,14 +113,18 @@ function bb_attachment($Text, $plaintext = false, $tryoembed = true) { else $oembed = $bookmark[0]; - if (($image != "") AND !strstr(strtolower($oembed), "
', $url, $image, $title); - elseif (($preview != "") AND !strstr(strtolower($oembed), "
', $url, $preview, $title); + if (strstr(strtolower($oembed), "