From 13c2f8d968ed5d76ff7d2272046a34e05ecd38da Mon Sep 17 00:00:00 2001 From: ZerooCool Date: Tue, 30 Jun 2020 22:36:36 +0200 Subject: [PATCH] Make Opengraph really functional 3 URLs of images used on social networks are passed in absolute URL. Note that I did not pass all the images in absolute URLs, but, it could be consistent to do so, but, if the images work, maybe a relative call is more efficient? Remove the version of PrivateBin, at the end of each image. This apparently prevents the opengraph from working, and, so I deleted on all of the images, to remain consistent at this level. This will make fewer requests, and, anyway, the images are not intended to change with each version. --- cfg/conf.sample.php | 4 ++++ lib/Configuration.php | 1 + lib/Controller.php | 1 + tpl/bootstrap.php | 12 ++++++------ 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/cfg/conf.sample.php b/cfg/conf.sample.php index e2ba01a1..06f403ef 100644 --- a/cfg/conf.sample.php +++ b/cfg/conf.sample.php @@ -7,6 +7,10 @@ ; (optional) set a project name to be displayed on the website ; name = "PrivateBin" +; The full URL, with the domain name and directories that point to the PrivateBin files +; This URL is essential to allow Opengraph images to be displayed on social networks +; path = "" + ; enable or disable the discussion feature, defaults to true discussion = true diff --git a/lib/Configuration.php b/lib/Configuration.php index 89db37ae..90134c1f 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -38,6 +38,7 @@ class Configuration private static $_defaults = array( 'main' => array( 'name' => 'PrivateBin', + 'path' => '', 'discussion' => true, 'opendiscussion' => false, 'password' => true, diff --git a/lib/Controller.php b/lib/Controller.php index 0c039f5f..6b6769d9 100644 --- a/lib/Controller.php +++ b/lib/Controller.php @@ -369,6 +369,7 @@ class Controller $page = new View; $page->assign('NAME', $this->_conf->getKey('name')); + $page->assign('PATH', I18n::_($this->_conf->getKey('path'))); $page->assign('ERROR', I18n::_($this->_error)); $page->assign('STATUS', I18n::_($this->_status)); $page->assign('VERSION', self::VERSION); diff --git a/tpl/bootstrap.php b/tpl/bootstrap.php index c06372ee..899be8b7 100644 --- a/tpl/bootstrap.php +++ b/tpl/bootstrap.php @@ -74,11 +74,11 @@ endif; - - - + + + - + @@ -86,11 +86,11 @@ endif; - + - +