fix: restrict deep_link to relative paths and http(s)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BCrwHHnGCB5XH968Nxokqw
This commit is contained in:
@@ -27,11 +27,18 @@ class UpsertEventsRequest extends FormRequest
|
||||
'events.*.payload' => ['required', 'array'],
|
||||
'events.*.payload.title' => ['required', 'string'],
|
||||
'events.*.payload.subtitle' => ['sometimes', 'nullable', 'string'],
|
||||
'events.*.payload.deep_link' => ['sometimes', 'nullable', 'string'],
|
||||
'events.*.payload.deep_link' => ['sometimes', 'nullable', 'string', 'max:2048', 'regex:#^(/|https?://)#'],
|
||||
'events.*.payload.done_label' => ['sometimes', 'nullable', 'string', 'max:64'],
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'events.*.payload.deep_link.regex' => 'deep_link должен быть относительным путём или http(s)-ссылкой',
|
||||
];
|
||||
}
|
||||
|
||||
public function after(): array
|
||||
{
|
||||
return [function (Validator $v) {
|
||||
|
||||
Reference in New Issue
Block a user