From a1c1a6cae81e2be2b8096e0d99826ae3dcd20c97 Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Mon, 28 Dec 2015 18:28:02 +0100 Subject: [PATCH] workaround for media.ccc.de oembed with size 0 --- mod/oembed.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mod/oembed.php b/mod/oembed.php index f79f66a483..cb478cb860 100644 --- a/mod/oembed.php +++ b/mod/oembed.php @@ -21,6 +21,12 @@ function oembed_content(&$a){ $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 "";