X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Foembed.php;h=bc127b5c3515f61cd061bcb63f9fa2710dc2f426;hb=7f6a7af2b3407f345043bb58756be14c4e12d3ae;hp=dbb96a67ca7e5aa9f14e9bfa7299ff77bf650e37;hpb=f6818ab2438f2274c5d820bc9b1f90ff7476c0b7;p=friendica.git diff --git a/include/oembed.php b/include/oembed.php index dbb96a67ca..bc127b5c35 100755 --- a/include/oembed.php +++ b/include/oembed.php @@ -74,9 +74,10 @@ function oembed_format_object($j){ switch ($j->type) { case "video": { if (isset($j->thumbnail_url)) { - $tw = (isset($j->thumbnail_width)) ? $j->thumbnail_width:200; - $th = (isset($j->thumbnail_height)) ? $j->thumbnail_height:180; - $tr = $tw/$th; + $tw = (isset($j->thumbnail_width) && intval($j->thumbnail_width)) ? $j->thumbnail_width:200; + $th = (isset($j->thumbnail_height) && intval($j->thumbnail_height)) ? $j->thumbnail_height:180; + // make sure we don't attempt divide by zero, fallback is a 1:1 ratio + $tr = (($th) ? $tw/$th : 1); $th=120; $tw = $th*$tr; $tpl=get_markup_template('oembed_video.tpl');