Skip to content
Snippets Groups Projects
Commit 11a3db27 authored by Alex's avatar Alex
Browse files

Correct User validator issue because of PCRE version used in PHP

parent 11e1b32b
No related branches found
No related tags found
1 merge request!1Include Wowa Training
Pipeline #5043 failed
......@@ -24,9 +24,10 @@ class UserController extends Controller
protected function validator(array $data)
{
return Validator::make($data, [
'name' => 'required|string|regex:/^[a-zA-Z0-9_\s-\.]+$/|max:255',
//This comment line works for PHP7.3 and newer, the previous one no.
//'name' => 'required|string|regex:/^[a-zA-Z0-9_\s.]+$/|max:255',
//Works for PHP < 7.3
//'name' => 'required|string|regex:/^[a-zA-Z0-9_\s-\.]+$/|max:255',
//works for PHP7.3 and newer, the previous one no.
'name' => 'required|string|regex:/^[a-zA-Z0-9_\s.]+$/|max:255',
'email' => 'required|email'
]);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment