Skip to content

Commit

Permalink
Merge pull request #65 from terrorfall/xss-patch
Browse files Browse the repository at this point in the history
Xss patch
  • Loading branch information
jeremykenedy authored May 22, 2020
2 parents 536c483 + 2acbbde commit b71874b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/App/Http/Controllers/UsersManagementController.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function create()
public function store(Request $request)
{
$rules = [
'name' => 'required|string|max:255|unique:users',
'name' => 'required|string|max:255|unique:users|alpha_dash',
'email' => 'required|email|max:255|unique:users',
'password' => 'required|string|confirmed|min:6',
'password_confirmation' => 'required|string|same:password',
Expand All @@ -104,6 +104,7 @@ public function store(Request $request)
$messages = [
'name.unique' => trans('laravelusers::laravelusers.messages.userNameTaken'),
'name.required' => trans('laravelusers::laravelusers.messages.userNameRequired'),
'name' => trans('laravelusers::laravelusers.messages.userNameInvalid'),
'email.required' => trans('laravelusers::laravelusers.messages.emailRequired'),
'email.email' => trans('laravelusers::laravelusers.messages.emailInvalid'),
'password.required' => trans('laravelusers::laravelusers.messages.passwordRequired'),
Expand Down Expand Up @@ -199,7 +200,7 @@ public function update(Request $request, $id)
];

if ($emailCheck) {
$rules['email'] = 'required|email|max:255|unique:users';
$rules['email'] = 'required|email|max:255|unique:users|alpha_dash';
}

if ($passwordCheck) {
Expand Down
1 change: 1 addition & 0 deletions src/resources/lang/en/laravelusers.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
'messages' => [
'userNameTaken' => 'Username is taken',
'userNameRequired' => 'Username is required',
'userNameInvalid' => 'Username is invalid',
'fNameRequired' => 'First Name is required',
'lNameRequired' => 'Last Name is required',
'emailRequired' => 'Email is required',
Expand Down

0 comments on commit b71874b

Please sign in to comment.