]> git.mxchange.org Git - friendica.git/commitdiff
youtube redirect fixes
authorFriendika <info@friendika.com>
Wed, 31 Aug 2011 06:09:39 +0000 (23:09 -0700)
committerFriendika <info@friendika.com>
Wed, 31 Aug 2011 06:09:39 +0000 (23:09 -0700)
include/bbcode.php
include/conversation.php
mod/item.php

index a3f2971e530eb0233bfcd18dcc650c3fc6ef0ad4..9ee8b7b36ceecb7b14538fcf183d67ed370b80c9 100644 (file)
@@ -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\]/", '<iframe width="425" height="349" src="http://www.youtube.com/embed/$1" frameborder="0" ></iframe>', $Text);
+               $Text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/", '<iframe width="425" height="350" src="http://www.youtube.com/embed/$1" frameborder="0" ></iframe>', $Text);
        }
-//     $Text = preg_replace("/\[youtube\](.*?)\[\/youtube\]/", '<object width="425" height="350" type="application/x-shockwave-flash" data="http://www.youtube.com/v/$1" ><param name="movie" value="http://www.youtube.com/v/$1"></param><!--[if IE]><embed src="http://www.youtube.com/v/$1" type="application/x-shockwave-flash" width="425" height="350" /><![endif]--></object>', $Text);
 
 
+//     $Text = preg_replace("/\[youtube\](.*?)\[\/youtube\]/", '<object width="425" height="350" type="application/x-shockwave-flash" data="http://www.youtube.com/v/$1" ><param name="movie" value="http://www.youtube.com/v/$1"></param><!--[if IE]><embed src="http://www.youtube.com/v/$1" type="application/x-shockwave-flash" width="425" height="350" /><![endif]--></object>', $Text);
+
 
        // oembed tag
        $Text = oembed_bbcode2html($Text);
index 3353cb2b73cd693907992d6a49159096c23bdfb4..6b5bf8d7c61acd61e6974bc630e2f083734b0a71 100644 (file)
@@ -80,8 +80,6 @@ function localize_item(&$item){
 
        }
         
-       // fix bad embeds
-       $item['body'] = str_replace('http://www.youtube.com/embed/http:','http:',$item['body']);
 
 }
 
index dd42014eb4f133010ad25c35bcede3d7ad182780..b6ea8ff0859c3c3b12033a32195c3890c1021344 100644 (file)
@@ -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'];