[PLUGIN][Embed] Fix links

This commit is contained in:
Diogo Peralta Cordeiro 2021-12-02 22:10:11 +00:00
parent e5f09a26d4
commit 2e11001b8f
Signed by: diogo
GPG Key ID: 18D2D35001FBFAB0

View File

@ -285,11 +285,11 @@ class Embed extends Plugin
$metadata['title'] = $info->title; $metadata['title'] = $info->title;
$metadata['description'] = $info->description; $metadata['description'] = $info->description;
$metadata['author_name'] = $info->authorName; $metadata['author_name'] = $info->authorName;
$metadata['author_url'] = (string) $info->authorUrl;
$metadata['provider_name'] = $info->providerName;
$root_url = parse_url($url); $root_url = parse_url($url);
$root_url = "{$root_url['scheme']}://{$root_url['host']}"; $root_url = "{$root_url['scheme']}://{$root_url['host']}";
$metadata['provider_url'] = (string) ($info->providerUrl != '' ? $info->providerUrl : $root_url); $metadata['author_url'] = $info->authorUrl ? (string)$info->authorUrl : $root_url;
$metadata['provider_name'] = $info->providerName;
$metadata['provider_url'] = (string)$info->providerUrl ?? $metadata['author_name'];
if (!\is_null($info->image)) { if (!\is_null($info->image)) {
$thumbnail_url = (string) $info->image; $thumbnail_url = (string) $info->image;