diff --git a/include/bbcode.php b/include/bbcode.php index a3f2971e53..9ee8b7b36c 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -133,12 +133,14 @@ function bbcode($Text,$preserve_nl = false) { } else { // Youtube extensions $Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/watch\?v\=(.*?)\[\/youtube\]/",'[youtube]$1[/youtube]',$Text); + $Text = preg_replace("/\[youtube\]https?:\/\/www.youtube.com\/embed\/(.*?)\[\/youtube\]/",'[youtube]$1[/youtube]',$Text); $Text = preg_replace("/\[youtube\]https?:\/\/youtu.be\/(.*?)\[\/youtube\]/",'[youtube]$1[/youtube]',$Text); - $Text = preg_replace("/\[youtube\](.*?)\[\/youtube\]/", '', $Text); + $Text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/", '', $Text); } -// $Text = preg_replace("/\[youtube\](.*?)\[\/youtube\]/", '', $Text); +// $Text = preg_replace("/\[youtube\](.*?)\[\/youtube\]/", '', $Text); + // oembed tag $Text = oembed_bbcode2html($Text); diff --git a/include/conversation.php b/include/conversation.php index 3353cb2b73..6b5bf8d7c6 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -80,8 +80,6 @@ function localize_item(&$item){ } - // fix bad embeds - $item['body'] = str_replace('http://www.youtube.com/embed/http:','http:',$item['body']); } diff --git a/mod/item.php b/mod/item.php index dd42014eb4..b6ea8ff085 100644 --- a/mod/item.php +++ b/mod/item.php @@ -353,7 +353,7 @@ function item_post(&$a) { * and we are replying, and there isn't one already */ - if(($parent_contact) && ($parent_contact['network'] === 'stat') + if(($parent_contact) && ($parent_contact['network'] === NETWORK_OSTATUS) && ($parent_contact['nick']) && (! in_array('@' . $parent_contact['nick'],$tags))) { $body = '@' . $parent_contact['nick'] . ' ' . $body; $tags[] = '@' . $parent_contact['nick'];