X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Foembed.php;h=19bdc474f545aa4b14e690970e0bf7b7a9042f2a;hb=67d39770ed69b385a927a269e4d406d0d252020e;hp=4a95bd8a45fe1212b419ca30149d0d6ddeda71fc;hpb=efd1e6fd8c31f3cab22e7dae7973386babc767a2;p=friendica.git diff --git a/include/oembed.php b/include/oembed.php index 4a95bd8a45..19bdc474f5 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 @@ -105,6 +110,8 @@ function oembed_fetch_url($embedurl, $no_rich_type = false){ } } + call_hooks('oembed_fetch_url', $embedurl, $j); + return $j; } @@ -156,6 +163,7 @@ function oembed_format_object($j){ // add link to source if not present in "rich" type if ($j->type!='rich' || !strpos($j->html,$embedurl) ){ + $ret .= "

"; if (isset($j->title)) { if (isset($j->provider_name)) $ret .= $j->provider_name.": "; @@ -175,15 +183,19 @@ 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; + $ret .= "

"; } else { // add for html2bbcode conversion - $ret .= ""; + $ret .= "$embedurl"; + $ret.="
"; } - $ret.="
"; return mb_convert_encoding($ret, 'HTML-ENTITIES', mb_detect_encoding($ret)); }