From 5468b9b2a52f75f98905ca08d80559460807df39 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Thu, 28 Aug 2014 01:14:46 +0200 Subject: [PATCH] oembed: Prevent empty links --- include/oembed.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/oembed.php b/include/oembed.php index 4a95bd8a45..2ecb11e1f5 100755 --- a/include/oembed.php +++ b/include/oembed.php @@ -175,13 +175,16 @@ function oembed_format_object($j){ $embedlink .= $j->author_name; } + if (trim($embedlink) == "") + $embedlink = $embedurl; + $ret .= "$embedlink"; } //if (isset($j->author_name)) $ret.=" by ".$j->author_name; //if (isset($j->provider_name)) $ret.=" on ".$j->provider_name; } else { // add for html2bbcode conversion - $ret .= ""; + $ret .= "$embedurl"; } $ret.="
"; return mb_convert_encoding($ret, 'HTML-ENTITIES', mb_detect_encoding($ret)); -- 2.39.5