head: enforce absolute links of og:image values
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 10 Feb 2019 22:45:38 +0000 (23:45 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Sun, 10 Feb 2019 22:48:48 +0000 (23:48 +0100)
Common replacement of Facebook requirement.

head.inc.php
nieuws/index.php

index 9e0cbd5e031b9b003abf4ef1ad209334bb1107ee..b2b64cc6224b07835bc6e144067367019b3203d5 100644 (file)
@@ -8,7 +8,7 @@
        <meta name="viewport" content="width=device-width">
        <!--[if lt IE 9]><script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script><![endif]-->
 <?php if (!empty($Place['image'])) { ?>
-       <meta property="og:image" content="<?= htmlspecialchars($Place['image']) ?>" />
+       <meta property="og:image" content="https://<?= $_SERVER['HTTP_HOST'] . htmlspecialchars($Place['image']) ?>" />
 <?php } ?>
 </head>
 <body>
index cf63a63669868bcbd73f5b5e99fdbebf50d5cbe0..4ffaa23d614be2d689a63190a46bd1f4cf2c84c1 100644 (file)
@@ -15,7 +15,7 @@ if ($page and !is_numeric($page)) {
        $Place[1] = ' <small class="date">'.$article->date.'</small>';
        print preg_replace('{(?<=<h2>)(.*?)(?=</h2>)}', ($edit ?: '\1').' [[1]]', ob_get_clean());
        if ($article->file and $article->image) {
-               $Place['image'] = "https://lijtweg.nl/".$article->thumb('600x');
+               $Place['image'] = "/".$article->thumb('600x');
        }
        if (!empty($User['admin'])) {
                $taglist = [];