Merge pull request #5296 from pixelfed/staging

Staging
This commit is contained in:
daniel 2024-09-13 00:08:10 -06:00 committed by GitHub
commit 34b4167aa0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 6 deletions

View file

@ -7,6 +7,7 @@ use Zttp\Zttp;
class DiscoverActor class DiscoverActor
{ {
protected $url; protected $url;
protected $response; protected $response;
public function __construct($url) public function __construct($url)
@ -17,9 +18,9 @@ class DiscoverActor
public function fetch() public function fetch()
{ {
$res = Zttp::withHeaders([ $res = Zttp::withHeaders([
'Accept' => 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"', 'Accept' => 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"',
'User-Agent' => 'PixelfedBot - https://pixelfed.org', 'User-Agent' => 'PixelfedBot - https://pixelfed.org',
])->get($this->url); ])->get($this->url);
$this->response = $res->body(); $this->response = $res->body();
return $this; return $this;
@ -40,7 +41,7 @@ class DiscoverActor
$this->fetch(); $this->fetch();
$res = $this->getResponse(); $res = $this->getResponse();
if (empty($res) || !in_array('type', $res) || $res['type'] !== 'Person') { if (empty($res) || ! in_array('type', $res) || $res['type'] !== 'Person') {
throw new \Exception('Invalid Actor Object'); throw new \Exception('Invalid Actor Object');
} }

View file

@ -11,7 +11,7 @@
<title>{{ $title ?? config_cache('app.name') }}</title> <title>{{ $title ?? config_cache('app.name') }}</title>
<link rel="manifest" href="{{url('/manifest.json')}}"> <link rel="manifest" href="{{url('/manifest.json')}}">
<meta property="og:logo" content="{{ url('/img/pixelfed-icon-color.png')}}" />
<meta property="og:site_name" content="Pixelfed"> <meta property="og:site_name" content="Pixelfed">
<meta property="og:title" content="{{ $ogTitle ?? $title ?? config_cache('app.name') }}"> <meta property="og:title" content="{{ $ogTitle ?? $title ?? config_cache('app.name') }}">
<meta property="og:type" content="{{ $ogType ?? 'article' }}"> <meta property="og:type" content="{{ $ogType ?? 'article' }}">
@ -72,7 +72,7 @@
<title>{{ $title ?? config_cache('app.name', 'Pixelfed') }}</title> <title>{{ $title ?? config_cache('app.name', 'Pixelfed') }}</title>
<link rel="manifest" href="/manifest.json"> <link rel="manifest" href="/manifest.json">
<meta property="og:logo" content="{{ url('/img/pixelfed-icon-color.png')}}" />
<meta property="og:site_name" content="Pixelfed"> <meta property="og:site_name" content="Pixelfed">
<meta property="og:title" content="{{ $ogTitle ?? $title ?? config_cache('app.name', 'pixelfed') }}"> <meta property="og:title" content="{{ $ogTitle ?? $title ?? config_cache('app.name', 'pixelfed') }}">
<meta property="og:type" content="{{ $ogType ?? 'article' }}"> <meta property="og:type" content="{{ $ogType ?? 'article' }}">