X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Foembed.php;h=0d7e5ee84f165f8ae74cfc62eb14f94978a1d4eb;hb=5c4d55c5e863fe37af45643819d93201627dad92;hp=29d462d8f7d2252629e1cd3fb75b6508b90c04f2;hpb=64946972b2004b0b8252da670d0e990143a40b77;p=friendica.git diff --git a/include/oembed.php b/include/oembed.php index 29d462d8f7..0d7e5ee84f 100755 --- a/include/oembed.php +++ b/include/oembed.php @@ -78,6 +78,11 @@ function oembed_fetch_url($embedurl, $no_rich_type = false){ if (!is_object($j)) return false; + // Always embed the SSL version + if (isset($j->html)) + $j->html = str_replace(array("http://www.youtube.com/", "http://player.vimeo.com/"), + array("https://www.youtube.com/", "https://player.vimeo.com/"), $j->html); + $j->embedurl = $embedurl; // If fetching information doesn't work, then improve via internal functions @@ -109,6 +114,8 @@ function oembed_fetch_url($embedurl, $no_rich_type = false){ } function oembed_format_object($j){ + require_once("mod/proxy.php"); + $a = get_app(); $embedurl = $j->embedurl; $jhtml = oembed_iframe($j->embedurl,(isset($j->width) ? $j->width : null), (isset($j->height) ? $j->height : null) ); @@ -138,8 +145,8 @@ function oembed_format_object($j){ $ret.="
"; }; break; case "photo": { - $ret.= ""; - //$ret.= ""; + $ret.= ""; + //$ret.= ""; $ret.="
"; }; break; case "link": { @@ -173,13 +180,16 @@ function oembed_format_object($j){ $embedlink .= $j->author_name; } + if (trim($embedlink) == "") + $embedlink = $embedurl; + $ret .= "$embedlink"; } //if (isset($j->author_name)) $ret.=" by ".$j->author_name; //if (isset($j->provider_name)) $ret.=" on ".$j->provider_name; } else { // add for html2bbcode conversion - $ret .= ""; + $ret .= "$embedurl"; } $ret.="
"; return mb_convert_encoding($ret, 'HTML-ENTITIES', mb_detect_encoding($ret));