mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-25 15:55:22 +00:00
Update StatusController, disable embeds from spam accounts
This commit is contained in:
parent
63b72c429c
commit
c167af43a4
1 changed files with 15 additions and 0 deletions
|
@ -115,10 +115,25 @@ class StatusController extends Controller
|
|||
->whereIsPrivate(false)
|
||||
->whereUsername($username)
|
||||
->first();
|
||||
|
||||
if(!$profile) {
|
||||
$content = view('status.embed-removed');
|
||||
return response($content)->header('X-Frame-Options', 'ALLOWALL');
|
||||
}
|
||||
|
||||
$aiCheck = Cache::remember('profile:ai-check:spam-login:' . $profile->id, 86400, function() use($profile) {
|
||||
$exists = AccountInterstitial::whereUserId($profile->user_id)->where('is_spam', 1)->count();
|
||||
if($exists) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
if($aiCheck) {
|
||||
$res = view('status.embed-removed');
|
||||
return response($res)->withHeaders(['X-Frame-Options' => 'ALLOWALL']);
|
||||
}
|
||||
$status = Status::whereProfileId($profile->id)
|
||||
->whereNull('uri')
|
||||
->whereScope('public')
|
||||
|
|
Loading…
Reference in a new issue