diff --git a/sourcecode/hub/app/Http/Requests/ContentFilter.php b/sourcecode/hub/app/Http/Requests/ContentFilter.php index 31c2cdc79..e1a11b3f8 100644 --- a/sourcecode/hub/app/Http/Requests/ContentFilter.php +++ b/sourcecode/hub/app/Http/Requests/ContentFilter.php @@ -44,7 +44,7 @@ public function rules(): array 'language' => ['sometimes', 'string', 'max:100'], 'sort' => ['sometimes', 'required', Rule::in('created', 'updated', 'views')], 'type' => ['sometimes', 'array'], - 'type.*' => ['string', 'max:255', 'regex:/^[a-zA-Z0-9._+ ]+$/'], + 'type.*' => ['string', 'max:255', 'regex:/^[a-zA-Z0-9._+() ]+$/'], ]; } diff --git a/sourcecode/hub/tests/Feature/ContentFilterTest.php b/sourcecode/hub/tests/Feature/ContentFilterTest.php index 3dc1d8eab..264df8994 100644 --- a/sourcecode/hub/tests/Feature/ContentFilterTest.php +++ b/sourcecode/hub/tests/Feature/ContentFilterTest.php @@ -17,7 +17,7 @@ public function testContentFilterValidation(): void $this->assertTrue($validator->passes()); // Type parameter - $validator = Validator::make(['type' => ['H5P.DragText', 'H5P.Flashcards', 'text', 'something else', 'something different']], $rules); + $validator = Validator::make(['type' => ['H5P.DragText', 'H5P.Flashcards', 'text', 'something else', 'something different', 'NDLA Virtual Tour (360)']], $rules); $this->assertTrue($validator->passes()); $validator = Validator::make(['type' => ["string\nvalue"]], $rules);