X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Foembed.php;h=7770c62fb0300356dd26476090638e32d88c16c2;hb=caad9f5214f9f8c94e487629007b0f33c1b2008d;hp=236625f68a662ac23b1631b659bfb7e15f875f1e;hpb=8a80ea24d1d8039be6dc532c9db23c60e71eb467;p=friendica.git diff --git a/mod/oembed.php b/mod/oembed.php index 236625f68a..7770c62fb0 100644 --- a/mod/oembed.php +++ b/mod/oembed.php @@ -1,7 +1,7 @@ query_string, LOGGER_ALL); if ($a->argv[1]=='b2h'){ @@ -9,17 +9,24 @@ function oembed_content(&$a){ echo oembed_replacecb($url); killme(); } - + if ($a->argv[1]=='h2b'){ $text = trim(hex2bin($_REQUEST['text'])); echo oembed_html2bbcode($text); killme(); } - + if ($a->argc == 2){ echo ""; $url = base64url_decode($a->argv[1]); $j = oembed_fetch_url($url); + + // workaround for media.ccc.de (and any other endpoint that return size 0) + if (substr($j->html, 0, 7) == "html, 'width="0"')) { + $j->html = ''. $j->html; + $j->html = str_replace('width="0"', '', $j->html); + $j->html = str_replace('height="0"', '', $j->html); + } echo $j->html; // logger('mod-oembed ' . $j->html, LOGGER_ALL); echo "";