diff --git a/src/Content/OEmbed.php b/src/Content/OEmbed.php index 3ab5b4fea8..58fe32ade1 100644 --- a/src/Content/OEmbed.php +++ b/src/Content/OEmbed.php @@ -202,23 +202,22 @@ class OEmbed // add link to source if not present in "rich" type if ($j->type != 'rich' || !strpos($j->html, $embedurl)) { $ret .= '

'; - if (isset($j->title)) { - if (isset($j->provider_name)) { + if (!empty($j->title)) { + if (!empty($j->provider_name)) { $ret .= $j->provider_name . ": "; } - $embedlink = (isset($j->title)) ? $j->title : $embedurl; - $ret .= '' . $embedlink . ''; - if (isset($j->author_name)) { + $ret .= '' . $j->title . ''; + if (!empty($j->author_name)) { $ret .= ' (' . $j->author_name . ')'; } - } elseif (isset($j->provider_name) || isset($j->author_name)) { + } elseif (!empty($j->provider_name) || !empty($j->author_name)) { $embedlink = ""; - if (isset($j->provider_name)) { + if (!empty($j->provider_name)) { $embedlink .= $j->provider_name; } - if (isset($j->author_name)) { + if (!empty($j->author_name)) { if ($embedlink != "") { $embedlink .= ": "; } @@ -230,6 +229,8 @@ class OEmbed } $ret .= '' . $embedlink . ''; + } else { + $ret .= '' . $embedurl . ''; } $ret .= "

"; } elseif (!strpos($j->html, $embedurl)) {