Skip to content

Commit

Permalink
Merge pull request #4 from lepidus/fixesLinkedinError
Browse files Browse the repository at this point in the history
Fixes linkedin error
  • Loading branch information
ajnyga authored May 3, 2024
2 parents 029d4ec + 6dd05eb commit 416ec70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions OpenGraphPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function submissionView($hookName, $args) {
$templateMgr->addHeader('openGraphSiteName', '<meta name="og:site_name" content="' . htmlspecialchars($context->getName($context->getPrimaryLocale())) . '"/>');
$templateMgr->addHeader('openGraphObjectType', '<meta name="og:type" content="' . htmlspecialchars($objectType) . '"/>');
$templateMgr->addHeader('openGraphTitle', '<meta name="og:title" content="' . htmlspecialchars($submission->getFullTitle($submission->getLocale())) . '"/>');
if ($abstract = PKPString::html2text($submission->getAbstract($submission->getLocale()))) $templateMgr->addHeader('openGraphDescription', '<meta name="og:description" content="' . htmlspecialchars($abstract) . '"/>');
if ($abstract = PKPString::html2text($submission->getAbstract($submission->getLocale()))) $templateMgr->addHeader('openGraphDescription', '<meta name="description" property="og:description" content="' . htmlspecialchars($abstract) . '"/>');
$templateMgr->addHeader('openGraphUrl', '<meta name="og:url" content="' . $request->url(null, $submissionPath[0], $submissionPath[1], array($submission->getBestId())) . '"/>');
if ($locale = $submission->getLocale()) $templateMgr->addHeader('openGraphLocale', '<meta name="og:locale" content="' . htmlspecialchars($locale) . '"/>');

Expand All @@ -86,7 +86,7 @@ function submissionView($hookName, $args) {
if ($submissionCoverImage = $submission->getCurrentPublication()->getLocalizedCoverImageUrl($submission->getData('contextId'))){
$openGraphImage = $submissionCoverImage;
}
$templateMgr->addHeader('openGraphImage', '<meta name="og:image" content="' . htmlspecialchars($openGraphImage) . '"/>');
$templateMgr->addHeader('openGraphImage', '<meta name="image" property="og:image" content="' . htmlspecialchars($openGraphImage) . '"/>');

if ($datePublished = $submission->getDatePublished()) {
$openGraphDateName = $applicationName == "omp" ? "book:release_date" : "article:published_time";
Expand Down

0 comments on commit 416ec70

Please sign in to comment.