Skip to content

Commit

Permalink
Fixed rendering of oembed with html.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-KM committed Oct 28, 2018
1 parent b8c2631 commit a4aebe6
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions application/src/Media/Renderer/OEmbed.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ public function render(PhpRenderer $view, MediaRepresentation $media,
$url = $data['url'];
$width = $data['width'];
$height = $data['height'];
if (!empty($data['title'])) {
$title = $data['title'];
} else {
$title = $url;
}
$title = empty($data['title']) ? $url : $data['title'];
return sprintf(
'<img src="%s" width="%s" height="%s" alt="%s">',
$view->escapeHtml($url),
Expand All @@ -29,14 +25,9 @@ public function render(PhpRenderer $view, MediaRepresentation $media,
);
} elseif (!empty($data['html'])) {
return $data['html'];
} else {
$source = $media->source();
if (!$empty($data['title'])) {
$title = $data['title'];
} else {
$title = $source;
}
return $view->hyperlink($title, $source);
}
$source = $media->source();
$title = empty($data['title']) ? $source : $data['title'];
return $view->hyperlink($title, $source);
}
}

0 comments on commit a4aebe6

Please sign in to comment.