diff --git a/controller/Request.class.php b/controller/Request.class.php index ab4b1091..84fbd0d2 100644 --- a/controller/Request.class.php +++ b/controller/Request.class.php @@ -80,6 +80,16 @@ class Request return static::getHttpHeader('Host') ? rtrim(static::getHttpHeader('Host'), '.') : ''; } + public static function getHostAndProto(): string + { + return (static::isSSL() ? 'https' : 'http') . '://' . static::getHost(); + } + + public static function isSSL(): bool + { + return static::getHeader('HTTPS') || strtolower(static::getHttpHeader('X_FORWARDED_PROTO')) == 'https'; + } + public static function getServerName(): string { return static::getHeader('SERVER_NAME'); @@ -105,4 +115,4 @@ class Request return preg_match('/(' . join('|', $bots) . ')/i', static::getUserAgent()); } -} \ No newline at end of file +} diff --git a/view/template/content/_postSocialShare.php b/view/template/content/_postSocialShare.php index 42b3f71b..6f4d67f0 100644 --- a/view/template/content/_postSocialShare.php +++ b/view/template/content/_postSocialShare.php @@ -1,4 +1,4 @@ -getRelativeUrl()) ?> +getRelativeUrl()) ?> getTitle()) ?>
\ No newline at end of file +