Updated OpenGraph title to display folder name instead of a nextcloud standard text

When sharing a folder via Facebook, WhatsApp or any other platform that makes use of OpenGraph, the display title was "Nextcloud - a safe home for all your data" and the description was the actual name of the folder. This should not be the case, so the display title has been changed to display the folder name and the description now displays the former OpenGraph title.

Signed-off-by: Sascha Sambale <mastixmc@gmail.com>

Fixing whitespaces and empty line.
This commit is contained in:
Sascha Sambale 2017-10-25 06:26:19 +02:00 committed by Morris Jobke
parent 9f5e1648c1
commit 30460b52df
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
1 changed files with 2 additions and 2 deletions

View File

@ -406,8 +406,8 @@ class ShareController extends Controller {
}
// OpenGraph Support: http://ogp.me/
\OCP\Util::addHeader('meta', ['property' => "og:title", 'content' => $this->defaults->getName() . ($this->defaults->getSlogan() !== '' ? ' - ' . $this->defaults->getSlogan() : '')]);
\OCP\Util::addHeader('meta', ['property' => "og:description", 'content' => $this->l10n->t('%s is publicly shared', [$shareTmpl['filename']])]);
\OCP\Util::addHeader('meta', ['property' => "og:title", 'content' => $shareTmpl['filename']]);
\OCP\Util::addHeader('meta', ['property' => "og:description", 'content' => $this->defaults->getName() . ($this->defaults->getSlogan() !== '' ? ' - ' . $this->defaults->getSlogan() : '')]);
\OCP\Util::addHeader('meta', ['property' => "og:site_name", 'content' => $this->defaults->getName()]);
\OCP\Util::addHeader('meta', ['property' => "og:url", 'content' => $shareTmpl['shareUrl']]);
\OCP\Util::addHeader('meta', ['property' => "og:type", 'content' => "object"]);