Replace all instances of 255 as a max length with 191; ref #2421
This commit is contained in:
parent
4f21fa85f8
commit
cc6f98c0fd
24 changed files with 41 additions and 38 deletions
|
@ -19,12 +19,12 @@ class EggFormRequest extends AdminFormRequest
|
|||
public function rules()
|
||||
{
|
||||
$rules = [
|
||||
'name' => 'required|string|max:255',
|
||||
'name' => 'required|string|max:191',
|
||||
'description' => 'nullable|string',
|
||||
'docker_image' => 'required|string|max:255',
|
||||
'docker_image' => 'required|string|max:191',
|
||||
'startup' => 'required|string',
|
||||
'config_from' => 'sometimes|bail|nullable|numeric',
|
||||
'config_stop' => 'required_without:config_from|nullable|string|max:255',
|
||||
'config_stop' => 'required_without:config_from|nullable|string|max:191',
|
||||
'config_startup' => 'required_without:config_from|nullable|json',
|
||||
'config_logs' => 'required_without:config_from|nullable|json',
|
||||
'config_files' => 'required_without:config_from|nullable|json',
|
||||
|
|
|
@ -15,9 +15,9 @@ class EggVariableFormRequest extends AdminFormRequest
|
|||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|min:1|max:255',
|
||||
'name' => 'required|string|min:1|max:191',
|
||||
'description' => 'sometimes|nullable|string',
|
||||
'env_variable' => 'required|regex:/^[\w]{1,255}$/|notIn:' . EggVariable::RESERVED_ENV_NAMES,
|
||||
'env_variable' => 'required|regex:/^[\w]{1,191}$/|notIn:' . EggVariable::RESERVED_ENV_NAMES,
|
||||
'options' => 'sometimes|required|array',
|
||||
'rules' => 'bail|required|string',
|
||||
'default_value' => 'present',
|
||||
|
|
|
@ -19,7 +19,7 @@ class StoreNestFormRequest extends AdminFormRequest
|
|||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|min:1|max:255',
|
||||
'name' => 'required|string|min:1|max:191',
|
||||
'description' => 'string|nullable',
|
||||
];
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ class AllocationFormRequest extends AdminFormRequest
|
|||
{
|
||||
return [
|
||||
'allocation_ip' => 'required|string',
|
||||
'allocation_alias' => 'sometimes|nullable|string|max:255',
|
||||
'allocation_alias' => 'sometimes|nullable|string|max:191',
|
||||
'allocation_ports' => 'required|array',
|
||||
];
|
||||
}
|
||||
|
|
|
@ -15,8 +15,8 @@ class AdvancedSettingsFormRequest extends AdminFormRequest
|
|||
{
|
||||
return [
|
||||
'recaptcha:enabled' => 'required|in:true,false',
|
||||
'recaptcha:secret_key' => 'required|string|max:255',
|
||||
'recaptcha:website_key' => 'required|string|max:255',
|
||||
'recaptcha:secret_key' => 'required|string|max:191',
|
||||
'recaptcha:website_key' => 'required|string|max:191',
|
||||
'pterodactyl:guzzle:timeout' => 'required|integer|between:1,60',
|
||||
'pterodactyl:guzzle:connect_timeout' => 'required|integer|between:1,60',
|
||||
'pterodactyl:console:count' => 'required|integer|min:1',
|
||||
|
|
|
@ -16,7 +16,7 @@ class BaseSettingsFormRequest extends AdminFormRequest
|
|||
public function rules()
|
||||
{
|
||||
return [
|
||||
'app:name' => 'required|string|max:255',
|
||||
'app:name' => 'required|string|max:191',
|
||||
'pterodactyl:auth:2fa_required' => 'required|integer|in:0,1,2',
|
||||
'app:locale' => ['required', 'string', Rule::in(array_keys($this->getAvailableLanguages()))],
|
||||
'app:analytics' => 'nullable|string',
|
||||
|
|
|
@ -18,10 +18,10 @@ class MailSettingsFormRequest extends AdminFormRequest
|
|||
'mail:host' => 'required|string',
|
||||
'mail:port' => 'required|integer|between:1,65535',
|
||||
'mail:encryption' => ['present', Rule::in([null, 'tls', 'ssl'])],
|
||||
'mail:username' => 'nullable|string|max:255',
|
||||
'mail:password' => 'nullable|string|max:255',
|
||||
'mail:username' => 'nullable|string|max:191',
|
||||
'mail:password' => 'nullable|string|max:191',
|
||||
'mail:from:address' => 'required|string|email',
|
||||
'mail:from:name' => 'nullable|string|max:255',
|
||||
'mail:from:name' => 'nullable|string|max:191',
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ class StoreAllocationRequest extends ApplicationApiRequest
|
|||
{
|
||||
return [
|
||||
'ip' => 'required|string',
|
||||
'alias' => 'sometimes|nullable|string|max:255',
|
||||
'alias' => 'sometimes|nullable|string|max:191',
|
||||
'ports' => 'required|array',
|
||||
'ports.*' => 'string',
|
||||
];
|
||||
|
|
|
@ -21,7 +21,7 @@ class StoreBackupRequest extends ClientApiRequest
|
|||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'nullable|string|max:255',
|
||||
'name' => 'nullable|string|max:191',
|
||||
'ignored' => 'nullable|string',
|
||||
];
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ class StoreSubuserRequest extends SubuserRequest
|
|||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'email' => 'required|email',
|
||||
'email' => 'required|email|between:1,191',
|
||||
'permissions' => 'required|array',
|
||||
'permissions.*' => 'string',
|
||||
];
|
||||
|
|
|
@ -50,7 +50,7 @@ class DatabaseHost extends Model
|
|||
* @var array
|
||||
*/
|
||||
public static $validationRules = [
|
||||
'name' => 'required|string|max:255',
|
||||
'name' => 'required|string|max:191',
|
||||
'host' => 'required|string',
|
||||
'port' => 'required|numeric|between:1,65535',
|
||||
'username' => 'required|string|max:32',
|
||||
|
|
|
@ -93,13 +93,13 @@ class Egg extends Model
|
|||
public static $validationRules = [
|
||||
'nest_id' => 'required|bail|numeric|exists:nests,id',
|
||||
'uuid' => 'required|string|size:36',
|
||||
'name' => 'required|string|max:255',
|
||||
'name' => 'required|string|max:191',
|
||||
'description' => 'string|nullable',
|
||||
'author' => 'required|string|email',
|
||||
'docker_image' => 'required|string|max:255',
|
||||
'docker_image' => 'required|string|max:191',
|
||||
'startup' => 'required|nullable|string',
|
||||
'config_from' => 'sometimes|bail|nullable|numeric|exists:eggs,id',
|
||||
'config_stop' => 'required_without:config_from|nullable|string|max:255',
|
||||
'config_stop' => 'required_without:config_from|nullable|string|max:191',
|
||||
'config_startup' => 'required_without:config_from|nullable|json',
|
||||
'config_logs' => 'required_without:config_from|nullable|json',
|
||||
'config_files' => 'required_without:config_from|nullable|json',
|
||||
|
|
|
@ -73,9 +73,9 @@ class EggVariable extends Model
|
|||
*/
|
||||
public static $validationRules = [
|
||||
'egg_id' => 'exists:eggs,id',
|
||||
'name' => 'required|string|between:1,255',
|
||||
'name' => 'required|string|between:1,191',
|
||||
'description' => 'string',
|
||||
'env_variable' => 'required|regex:/^[\w]{1,255}$/|notIn:' . self::RESERVED_ENV_NAMES,
|
||||
'env_variable' => 'required|regex:/^[\w]{1,191}$/|notIn:' . self::RESERVED_ENV_NAMES,
|
||||
'default_value' => 'string',
|
||||
'user_viewable' => 'boolean',
|
||||
'user_editable' => 'boolean',
|
||||
|
|
|
@ -41,7 +41,7 @@ class Location extends Model
|
|||
*/
|
||||
public static $validationRules = [
|
||||
'short' => 'required|string|between:1,60|unique:locations,short',
|
||||
'long' => 'string|nullable|between:1,255',
|
||||
'long' => 'string|nullable|between:1,191',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
@ -56,7 +56,7 @@ class Mount extends Model
|
|||
*/
|
||||
public static $validationRules = [
|
||||
'name' => 'required|string|min:2|max:64|unique:mounts,name',
|
||||
'description' => 'nullable|string|max:255',
|
||||
'description' => 'nullable|string|max:191',
|
||||
'source' => 'required|string',
|
||||
'target' => 'required|string',
|
||||
'read_only' => 'sometimes|boolean',
|
||||
|
|
|
@ -44,7 +44,7 @@ class Nest extends Model
|
|||
*/
|
||||
public static $validationRules = [
|
||||
'author' => 'required|string|email',
|
||||
'name' => 'required|string|max:255',
|
||||
'name' => 'required|string|max:191',
|
||||
'description' => 'nullable|string',
|
||||
];
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ class Schedule extends Model
|
|||
*/
|
||||
public static $validationRules = [
|
||||
'server_id' => 'required|exists:servers,id',
|
||||
'name' => 'required|string|max:255',
|
||||
'name' => 'required|string|max:191',
|
||||
'cron_day_of_week' => 'required|string',
|
||||
'cron_day_of_month' => 'required|string',
|
||||
'cron_hour' => 'required|string',
|
||||
|
|
|
@ -103,7 +103,7 @@ class Server extends Model
|
|||
public static $validationRules = [
|
||||
'external_id' => 'sometimes|nullable|string|between:1,191|unique:servers',
|
||||
'owner_id' => 'required|integer|exists:users,id',
|
||||
'name' => 'required|string|min:1|max:255',
|
||||
'name' => 'required|string|min:1|max:191',
|
||||
'node_id' => 'required|exists:nodes,id',
|
||||
'description' => 'string',
|
||||
'memory' => 'required|numeric|min:0',
|
||||
|
@ -118,7 +118,7 @@ class Server extends Model
|
|||
'egg_id' => 'required|exists:eggs,id',
|
||||
'startup' => 'required|string',
|
||||
'skip_scripts' => 'sometimes|boolean',
|
||||
'image' => 'required|string|max:255',
|
||||
'image' => 'required|string|max:191',
|
||||
'installed' => 'in:0,1,2',
|
||||
'database_limit' => 'present|nullable|integer|min:0',
|
||||
'allocation_limit' => 'sometimes|nullable|integer|min:0',
|
||||
|
|
|
@ -25,7 +25,7 @@ class Setting extends Model
|
|||
* @var array
|
||||
*/
|
||||
public static $validationRules = [
|
||||
'key' => 'required|string|between:1,255',
|
||||
'key' => 'required|string|between:1,191',
|
||||
'value' => 'string',
|
||||
];
|
||||
}
|
||||
|
|
|
@ -137,11 +137,11 @@ class User extends Model implements
|
|||
*/
|
||||
public static $validationRules = [
|
||||
'uuid' => 'required|string|size:36|unique:users,uuid',
|
||||
'email' => 'required|email|unique:users,email',
|
||||
'external_id' => 'sometimes|nullable|string|max:255|unique:users,external_id',
|
||||
'username' => 'required|between:1,255|unique:users,username',
|
||||
'name_first' => 'required|string|between:1,255',
|
||||
'name_last' => 'required|string|between:1,255',
|
||||
'email' => 'required|email|between:1,191|unique:users,email',
|
||||
'external_id' => 'sometimes|nullable|string|max:191|unique:users,external_id',
|
||||
'username' => 'required|between:1,191|unique:users,username',
|
||||
'name_first' => 'required|string|between:1,191',
|
||||
'name_last' => 'required|string|between:1,191',
|
||||
'password' => 'sometimes|nullable|string',
|
||||
'root_admin' => 'boolean',
|
||||
'language' => 'string',
|
||||
|
|
Reference in a new issue