mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-01-18 02:20:46 +00:00
Increase username length limit from 15 to 30
This commit is contained in:
parent
83c1a7fd4b
commit
207bb36c89
8 changed files with 10 additions and 10 deletions
|
@ -64,7 +64,7 @@ class AdminInviteController extends Controller
|
||||||
$usernameRules = [
|
$usernameRules = [
|
||||||
'required',
|
'required',
|
||||||
'min:2',
|
'min:2',
|
||||||
'max:15',
|
'max:30',
|
||||||
'unique:users',
|
'unique:users',
|
||||||
function ($attribute, $value, $fail) {
|
function ($attribute, $value, $fail) {
|
||||||
$dash = substr_count($value, '-');
|
$dash = substr_count($value, '-');
|
||||||
|
@ -152,7 +152,7 @@ class AdminInviteController extends Controller
|
||||||
'username' => [
|
'username' => [
|
||||||
'required',
|
'required',
|
||||||
'min:2',
|
'min:2',
|
||||||
'max:15',
|
'max:30',
|
||||||
'unique:users',
|
'unique:users',
|
||||||
function ($attribute, $value, $fail) {
|
function ($attribute, $value, $fail) {
|
||||||
$dash = substr_count($value, '-');
|
$dash = substr_count($value, '-');
|
||||||
|
|
|
@ -519,7 +519,7 @@ class ApiV1Dot1Controller extends Controller
|
||||||
'username' => [
|
'username' => [
|
||||||
'required',
|
'required',
|
||||||
'min:2',
|
'min:2',
|
||||||
'max:15',
|
'max:30',
|
||||||
'unique:users',
|
'unique:users',
|
||||||
function ($attribute, $value, $fail) {
|
function ($attribute, $value, $fail) {
|
||||||
$dash = substr_count($value, '-');
|
$dash = substr_count($value, '-');
|
||||||
|
|
|
@ -69,7 +69,7 @@ class RegisterController extends Controller
|
||||||
$usernameRules = [
|
$usernameRules = [
|
||||||
'required',
|
'required',
|
||||||
'min:2',
|
'min:2',
|
||||||
'max:15',
|
'max:30',
|
||||||
'unique:users',
|
'unique:users',
|
||||||
function ($attribute, $value, $fail) {
|
function ($attribute, $value, $fail) {
|
||||||
$dash = substr_count($value, '-');
|
$dash = substr_count($value, '-');
|
||||||
|
|
|
@ -79,7 +79,7 @@ class FederationController extends Controller
|
||||||
if (str_starts_with($resource, 'https://')) {
|
if (str_starts_with($resource, 'https://')) {
|
||||||
if (str_starts_with($resource, 'https://'.$domain.'/users/')) {
|
if (str_starts_with($resource, 'https://'.$domain.'/users/')) {
|
||||||
$username = str_replace('https://'.$domain.'/users/', '', $resource);
|
$username = str_replace('https://'.$domain.'/users/', '', $resource);
|
||||||
if (strlen($username) > 15) {
|
if (strlen($username) > 30) {
|
||||||
return response('', 400);
|
return response('', 400);
|
||||||
}
|
}
|
||||||
$stripped = str_replace(['_', '.', '-'], '', $username);
|
$stripped = str_replace(['_', '.', '-'], '', $username);
|
||||||
|
|
|
@ -344,7 +344,7 @@ class ProfileController extends Controller
|
||||||
return response($res)->withHeaders(['X-Frame-Options' => 'ALLOWALL']);
|
return response($res)->withHeaders(['X-Frame-Options' => 'ALLOWALL']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen($username) > 15 || strlen($username) < 2) {
|
if (strlen($username) > 30 || strlen($username) < 2) {
|
||||||
return response($res)->withHeaders(['X-Frame-Options' => 'ALLOWALL']);
|
return response($res)->withHeaders(['X-Frame-Options' => 'ALLOWALL']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -358,7 +358,7 @@ class RemoteAuthController extends Controller
|
||||||
'username' => [
|
'username' => [
|
||||||
'required',
|
'required',
|
||||||
'min:2',
|
'min:2',
|
||||||
'max:15',
|
'max:30',
|
||||||
function ($attribute, $value, $fail) {
|
function ($attribute, $value, $fail) {
|
||||||
$dash = substr_count($value, '-');
|
$dash = substr_count($value, '-');
|
||||||
$underscore = substr_count($value, '_');
|
$underscore = substr_count($value, '_');
|
||||||
|
@ -489,7 +489,7 @@ class RemoteAuthController extends Controller
|
||||||
'username' => [
|
'username' => [
|
||||||
'required',
|
'required',
|
||||||
'min:2',
|
'min:2',
|
||||||
'max:15',
|
'max:30',
|
||||||
'unique:users,username',
|
'unique:users,username',
|
||||||
function ($attribute, $value, $fail) {
|
function ($attribute, $value, $fail) {
|
||||||
$dash = substr_count($value, '-');
|
$dash = substr_count($value, '-');
|
||||||
|
|
|
@ -119,7 +119,7 @@ class SiteController extends Controller
|
||||||
public function followIntent(Request $request)
|
public function followIntent(Request $request)
|
||||||
{
|
{
|
||||||
$this->validate($request, [
|
$this->validate($request, [
|
||||||
'user' => 'string|min:1|max:15|exists:users,username',
|
'user' => 'string|min:1|max:30|exists:users,username',
|
||||||
]);
|
]);
|
||||||
$profile = Profile::whereUsername($request->input('user'))->firstOrFail();
|
$profile = Profile::whereUsername($request->input('user'))->firstOrFail();
|
||||||
$user = $request->user();
|
$user = $request->user();
|
||||||
|
|
|
@ -27,7 +27,7 @@ class UserEmailForgotController extends Controller
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
{
|
{
|
||||||
$rules = [
|
$rules = [
|
||||||
'username' => 'required|min:2|max:15|exists:users'
|
'username' => 'required|min:2|max:30|exists:users'
|
||||||
];
|
];
|
||||||
|
|
||||||
$messages = [
|
$messages = [
|
||||||
|
|
Loading…
Reference in a new issue