Merge pull request #5429 from pixelfed/staging

Fix oauth endpoint
This commit is contained in:
daniel 2025-01-04 16:40:44 -07:00 committed by GitHub
commit 18c95136fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -137,7 +137,10 @@ class ApiV1Controller extends Controller
'redirect_uris' => 'required',
]);
$uris = implode(',', explode('\n', $request->redirect_uris));
$uris = collect(explode("\n", $request->redirect_uris))
->map('urldecode')
->filter()
->join(',');
$client = Passport::client()->forceFill([
'user_id' => null,
@ -3494,7 +3497,7 @@ class ApiV1Controller extends Controller
return [];
}
$defaultCaption = "";
$defaultCaption = '';
$content = $request->filled('status') ? strip_tags($request->input('status')) : $defaultCaption;
$cw = $user->profile->cw == true ? true : $request->boolean('sensitive', false);
$spoilerText = $cw && $request->filled('spoiler_text') ? $request->input('spoiler_text') : null;
@ -3687,7 +3690,7 @@ class ApiV1Controller extends Controller
}
}
$defaultCaption = config_cache('database.default') === 'mysql' ? null : "";
$defaultCaption = config_cache('database.default') === 'mysql' ? null : '';
$share = Status::firstOrCreate([
'caption' => $defaultCaption,
'rendered' => $defaultCaption,