diff options
Diffstat (limited to 'plugins/share/init.php')
-rw-r--r-- | plugins/share/init.php | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/plugins/share/init.php b/plugins/share/init.php index 64a9054eb..359d86802 100644 --- a/plugins/share/init.php +++ b/plugins/share/init.php @@ -142,13 +142,16 @@ class Share extends Plugin { $line); $enclosures = Article::_get_enclosures($line["id"]); - list ($og_image, $og_stream) = Article::_get_image($enclosures, $line['content'], $line["site_url"], $line); + list ($og_image, $og_stream) = Article::_get_image($enclosures, $line['content'], $line["site_url"] ?? "", $line); $content_decoded = html_entity_decode($line["title"], ENT_NOQUOTES | ENT_HTML401); $parsed_updated = TimeHelper::make_local_datetime($line["updated"], true, $owner_uid, true); $line['content'] = DiskCache::rewrite_urls($line['content']); + if (!$og_image) + $og_image = Config::get_self_url() . "/images/favicon-512px.png"; + ob_start(); ?> @@ -180,27 +183,28 @@ class Share extends Plugin { strip_tags($content_decoded) ) ), 500, "...")) ?>"> - </head> - <?php if ($og_image) { ?> - <meta property='og:image' content="<?= htmlspecialchars($og_image) ?>"> - <?php } ?> + <?php if ($og_image) { ?> + <meta property='og:image' content="<?= htmlspecialchars($og_image) ?>"> + <?php } ?> + </head> <body class='flat ttrss_utility ttrss_zoom css_loading'> <div class='container'> - <?php if (!empty($line["link"])) { ?> - <h1> - <a target='_blank' rel='noopener noreferrer' - href="<?= htmlspecialchars($line["link"]) ?>"><?= htmlspecialchars($line["title"]) ?></a> - </h1> - <?php } else { ?> - <h1><?= $line["title"] ?></h1> - <?php } ?> - <div class='content post'> <div class='header'> <div class='row'> + <?php if (!empty($line["link"])) { ?> + <h1> + <a rel='noopener noreferrer' + href="<?= htmlspecialchars($line["link"]) ?>"><?= htmlspecialchars($line["title"]) ?></a> + </h1> + <?php } else { ?> + <h1><?= $line["title"] ?></h1> + <?php } ?> + </div> + <div class='row'> <div><?= $line['author'] ?></div> <div><?= $parsed_updated ?></div> </div> |