1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-23 16:24:29 +00:00

Update PrivacySettings

This commit is contained in:
Daniel Supernault 2019-06-23 23:31:07 -06:00
parent 95807c93e5
commit 74b76ac175
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -10,6 +10,7 @@ use App\Profile;
use App\User;
use App\UserFilter;
use App\Util\Lexer\PrettyNumber;
use App\Util\ActivityPub\Helpers;
use Auth, Cache, DB;
use Illuminate\Http\Request;
@ -134,9 +135,13 @@ trait PrivacySettings
public function blockedInstanceStore(Request $request)
{
$this->validate($request, [
'domain' => 'required|active_url'
'domain' => 'required|url|min:1|max:120'
]);
$domain = $request->input('domain');
if(Helpers::validateUrl($domain) == false) {
return abort(400, 'Invalid domain');
}
$domain = parse_url($domain, PHP_URL_HOST);
$instance = Instance::firstOrCreate(['domain' => $domain]);
$filter = new UserFilter;
$filter->user_id = Auth::user()->profile->id;