From ab960cda7c61db599d24aed9a10f922b30021773 Mon Sep 17 00:00:00 2001 From: shibafu Date: Tue, 21 Jul 2020 22:55:11 +0900 Subject: [PATCH] fix validation --- app/Http/Controllers/Api/WebhookController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Api/WebhookController.php b/app/Http/Controllers/Api/WebhookController.php index 112068f..a7aa37d 100644 --- a/app/Http/Controllers/Api/WebhookController.php +++ b/app/Http/Controllers/Api/WebhookController.php @@ -32,11 +32,11 @@ class WebhookController extends Controller 'note' => 'nullable|string|max:500', 'link' => 'nullable|url|max:2000', 'tags' => 'nullable|array', - 'tags.*' => ['string', 'not_regex:/\s/u'], + 'tags.*' => ['string', 'not_regex:/[\s\r\n]/u', 'max:255'], 'is_private' => 'nullable|boolean', 'is_too_sensitive' => 'nullable|boolean', ], [ - 'tags.*.not_regex' => 'The :attribute cannot contain spaces.' + 'tags.*.not_regex' => 'The :attribute cannot contain spaces, tabs and newlines.' ]); if ($validator->fails()) {