X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Foembed.php;h=69583167cfedfdf7a8ef03dd6fe1a4ba9582eed9;hb=cbe4e2bf8c7b6fea2e700811a15b427e6141c9dd;hp=2ecb11e1f5f684d45b8f2f739476ad6c0254af97;hpb=5468b9b2a52f75f98905ca08d80559460807df39;p=friendica.git diff --git a/include/oembed.php b/include/oembed.php index 2ecb11e1f5..69583167cf 100755 --- a/include/oembed.php +++ b/include/oembed.php @@ -11,7 +11,6 @@ function oembed_replacecb($matches){ function oembed_fetch_url($embedurl, $no_rich_type = false){ - $embedurl = trim($embedurl, "'"); $embedurl = trim($embedurl, '"'); @@ -78,6 +77,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 +109,8 @@ function oembed_fetch_url($embedurl, $no_rich_type = false){ } } + call_hooks('oembed_fetch_url', $embedurl, $j); + return $j; } @@ -156,6 +162,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.": "; @@ -182,11 +189,12 @@ function oembed_format_object($j){ } //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 .= "$embedurl"; + $ret.="
"; } - $ret.="
"; return mb_convert_encoding($ret, 'HTML-ENTITIES', mb_detect_encoding($ret)); }