1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 23:02:42 +01:00

Include OpenGraph prefix material in <html> tag if OpenGraph is enabled

Summary: Ref T13018. Discourse doesn't seem to be picking this up yet (see <https://discourse.phabricator-community.org/t/opengraph-test-topic/762>) so maybe it really needs this meta-meta-XML stuff?

Test Plan: Will push.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13018

Differential Revision: https://secure.phabricator.com/D18781
This commit is contained in:
epriestley 2017-11-22 11:25:51 -08:00
parent 2c72c2b924
commit c3d6c4b0ee
4 changed files with 10 additions and 2 deletions

View file

@ -292,6 +292,7 @@ return array(
'rsrc/favicons/mstile-310x150.png' => '4a49d3ee', 'rsrc/favicons/mstile-310x150.png' => '4a49d3ee',
'rsrc/favicons/mstile-310x310.png' => 'a52ab264', 'rsrc/favicons/mstile-310x310.png' => 'a52ab264',
'rsrc/favicons/mstile-70x70.png' => '5edce7b8', 'rsrc/favicons/mstile-70x70.png' => '5edce7b8',
'rsrc/favicons/opengraph-144x144.png' => '648fb0fc',
'rsrc/image/BFCFDA.png' => 'd5ec91f4', 'rsrc/image/BFCFDA.png' => 'd5ec91f4',
'rsrc/image/actions/edit.png' => '2fc41442', 'rsrc/image/actions/edit.png' => '2fc41442',
'rsrc/image/avatar.png' => '17d346a4', 'rsrc/image/avatar.png' => '17d346a4',

View file

@ -59,9 +59,15 @@ abstract class AphrontPageView extends AphrontView {
), ),
array($body, $tail)); array($body, $tail));
if (PhabricatorEnv::getEnvConfig('policy.allow-public')) {
$html_open_tag = hsprintf('<html prefix="og: http://ogp.me/ns#">');
} else {
$html_open_tag = hsprintf('<html>');
}
$response = hsprintf( $response = hsprintf(
'<!DOCTYPE html>'. '<!DOCTYPE html>'.
'<html>'. '%s'.
'<head>'. '<head>'.
'<meta charset="UTF-8" />'. '<meta charset="UTF-8" />'.
'<title>%s</title>'. '<title>%s</title>'.
@ -69,6 +75,7 @@ abstract class AphrontPageView extends AphrontView {
'</head>'. '</head>'.
'%s'. '%s'.
'</html>', '</html>',
$html_open_tag,
$title, $title,
$head, $head,
$body); $body);

View file

@ -936,7 +936,7 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView
), ),
array( array(
'og:image', 'og:image',
PhabricatorCustomLogoConfigType::getLogoURI($viewer), celerity_get_resource_uri('rsrc/favicons/opengraph-144x144.png'),
), ),
); );

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB