oembed: Prevent empty links
This commit is contained in:
parent
b4e8ec2806
commit
5468b9b2a5
|
@ -175,13 +175,16 @@ function oembed_format_object($j){
|
||||||
|
|
||||||
$embedlink .= $j->author_name;
|
$embedlink .= $j->author_name;
|
||||||
}
|
}
|
||||||
|
if (trim($embedlink) == "")
|
||||||
|
$embedlink = $embedurl;
|
||||||
|
|
||||||
$ret .= "<a href='$embedurl' rel='oembed'>$embedlink</a>";
|
$ret .= "<a href='$embedurl' rel='oembed'>$embedlink</a>";
|
||||||
}
|
}
|
||||||
//if (isset($j->author_name)) $ret.=" by ".$j->author_name;
|
//if (isset($j->author_name)) $ret.=" by ".$j->author_name;
|
||||||
//if (isset($j->provider_name)) $ret.=" on ".$j->provider_name;
|
//if (isset($j->provider_name)) $ret.=" on ".$j->provider_name;
|
||||||
} else {
|
} else {
|
||||||
// add <a> for html2bbcode conversion
|
// 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>";
|
$ret.="<br style='clear:left'></span>";
|
||||||
return mb_convert_encoding($ret, 'HTML-ENTITIES', mb_detect_encoding($ret));
|
return mb_convert_encoding($ret, 'HTML-ENTITIES', mb_detect_encoding($ret));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user