mirror of
https://github.com/friendica/friendica
synced 2025-04-25 01:10:12 +00:00
divide by zero on incorrectly specified oembed thumbnail size
This commit is contained in:
parent
6b36863dd8
commit
3f63a69d7a
3 changed files with 10 additions and 9 deletions
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue