mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
Add instance post/profile embed config setting
This commit is contained in:
parent
1b9e50f39b
commit
7734dc033b
3 changed files with 14 additions and 0 deletions
|
@ -243,6 +243,10 @@ class ProfileController extends Controller
|
||||||
{
|
{
|
||||||
$res = view('profile.embed-removed');
|
$res = view('profile.embed-removed');
|
||||||
|
|
||||||
|
if(!config('instance.embed.profile')) {
|
||||||
|
return response($res)->withHeaders(['X-Frame-Options' => 'ALLOWALL']);
|
||||||
|
}
|
||||||
|
|
||||||
if(strlen($username) > 15 || strlen($username) < 2) {
|
if(strlen($username) > 15 || strlen($username) < 2) {
|
||||||
return response($res)->withHeaders(['X-Frame-Options' => 'ALLOWALL']);
|
return response($res)->withHeaders(['X-Frame-Options' => 'ALLOWALL']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,6 +106,11 @@ class StatusController extends Controller
|
||||||
|
|
||||||
public function showEmbed(Request $request, $username, int $id)
|
public function showEmbed(Request $request, $username, int $id)
|
||||||
{
|
{
|
||||||
|
if(!config('instance.embed.post')) {
|
||||||
|
$res = view('status.embed-removed');
|
||||||
|
return response($res)->withHeaders(['X-Frame-Options' => 'ALLOWALL']);
|
||||||
|
}
|
||||||
|
|
||||||
$profile = Profile::whereNull(['domain','status'])
|
$profile = Profile::whereNull(['domain','status'])
|
||||||
->whereIsPrivate(false)
|
->whereIsPrivate(false)
|
||||||
->whereUsername($username)
|
->whereUsername($username)
|
||||||
|
|
|
@ -86,4 +86,9 @@ return [
|
||||||
'enable_cc' => env('ENABLE_CONFIG_CACHE', false),
|
'enable_cc' => env('ENABLE_CONFIG_CACHE', false),
|
||||||
|
|
||||||
'has_legal_notice' => env('INSTANCE_LEGAL_NOTICE', false),
|
'has_legal_notice' => env('INSTANCE_LEGAL_NOTICE', false),
|
||||||
|
|
||||||
|
'embed' => [
|
||||||
|
'profile' => env('INSTANCE_PROFILE_EMBEDS', true),
|
||||||
|
'post' => env('INSTANCE_POST_EMBEDS', true),
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue