]> git.mxchange.org Git - friendica.git/commitdiff
oembed: Prevent empty links
authorMichael Vogel <icarus@dabo.de>
Wed, 27 Aug 2014 23:14:46 +0000 (01:14 +0200)
committerMichael Vogel <icarus@dabo.de>
Wed, 27 Aug 2014 23:14:46 +0000 (01:14 +0200)
include/oembed.php

index 4a95bd8a45fe1212b419ca30149d0d6ddeda71fc..2ecb11e1f5f684d45b8f2f739476ad6c0254af97 100755 (executable)
@@ -175,13 +175,16 @@ function oembed_format_object($j){
 
                                $embedlink .= $j->author_name;
                        }
+                       if (trim($embedlink) == "")
+                               $embedlink = $embedurl;
+
                        $ret .= "<a href='$embedurl' rel='oembed'>$embedlink</a>";
                }
                //if (isset($j->author_name)) $ret.=" by ".$j->author_name;
                //if (isset($j->provider_name)) $ret.=" on ".$j->provider_name;
        } else {
                // add <a> for html2bbcode conversion
-               $ret .= "<a href='$embedurl' rel='oembed'></a>";
+               $ret .= "<a href='$embedurl' rel='oembed'>$embedurl</a>";
        }
        $ret.="<br style='clear:left'></span>";
        return  mb_convert_encoding($ret, 'HTML-ENTITIES', mb_detect_encoding($ret));