X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fbbcode.php;h=c2d9326748e8ff61ec696daf95a29b7a1e3fe5dd;hb=072e4146369ae8ec10af961b7e1b25dc491e8f07;hp=6fadbaf7eb4d81536c4a8cecb917c36d45e76eb7;hpb=85f709320b588f3231875d097217bd9abd223c9f;p=friendica.git diff --git a/include/bbcode.php b/include/bbcode.php index 6fadbaf7eb..c2d9326748 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -80,7 +80,7 @@ function bbcode($Text,$preserve_nl = false) { // Images // [img]pathtoimage[/img] - $Text = preg_replace("/\[img\](.+?)\[\/img\]/", '', $Text); + $Text = preg_replace("/\[img\](.+?)\[\/img\]/", '' . t('Image/photo') . '', $Text); // html5 video and audio @@ -90,11 +90,15 @@ function bbcode($Text,$preserve_nl = false) { // [img=widthxheight]image source[/img] - $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.+?)\[\/img\]/", '', $Text); + $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.+?)\[\/img\]/", '', $Text); // Youtube extensions $Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/watch\?v\=(.+?)\[\/youtube\]/",'[youtube]$1[/youtube]',$Text); - $Text = preg_replace("/\[youtube\](.+?)\[\/youtube\]/", '', $Text); + $Text = preg_replace("/\[youtube\]https?:\/\/youtu.be\/(.+?)\[\/youtube\]/",'[youtube]$1[/youtube]',$Text); + + $Text = preg_replace("/\[youtube\](.+?)\[\/youtube\]/", '
', $Text); + +// $Text = preg_replace("/\[youtube\](.+?)\[\/youtube\]/", '
', $Text); // oembed tag $Text = oembed_bbcode2html($Text);