From a4aebe6f733723d95c6c900e878d056c55a8fca1 Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 29 Oct 2018 00:00:00 +0100 Subject: [PATCH] Fixed rendering of oembed with html. --- application/src/Media/Renderer/OEmbed.php | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/application/src/Media/Renderer/OEmbed.php b/application/src/Media/Renderer/OEmbed.php index 9c21bde595..8f8299e07b 100644 --- a/application/src/Media/Renderer/OEmbed.php +++ b/application/src/Media/Renderer/OEmbed.php @@ -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( '%s', $view->escapeHtml($url), @@ -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); } }