Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo-1
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
solo-1
Commits
bb3d1d2a
Commit
bb3d1d2a
authored
Aug 13, 2017
by
nanolikeyou
Committed by
GitHub
Aug 13, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update UserMgmtService.java
valid email&username to fix an XSS vulnerability
parent
c2421380
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
src/main/java/org/b3log/solo/service/UserMgmtService.java
src/main/java/org/b3log/solo/service/UserMgmtService.java
+6
-0
No files found.
src/main/java/org/b3log/solo/service/UserMgmtService.java
View file @
bb3d1d2a
...
...
@@ -274,6 +274,9 @@ public class UserMgmtService {
try
{
final
JSONObject
user
=
new
JSONObject
();
final
String
userEmail
=
requestJSONObject
.
optString
(
User
.
USER_EMAIL
).
trim
().
toLowerCase
();
if
(!
Strings
.
isEmail
(
userEmail
))
{
throw
new
ServiceException
(
langPropsService
.
get
(
"mailInvalidLabel"
));
}
final
JSONObject
duplicatedUser
=
userRepository
.
getByEmail
(
userEmail
);
if
(
null
!=
duplicatedUser
)
{
...
...
@@ -287,6 +290,9 @@ public class UserMgmtService {
user
.
put
(
User
.
USER_EMAIL
,
userEmail
);
final
String
userName
=
requestJSONObject
.
optString
(
User
.
USER_NAME
);
if
(
UserExt
.
invalidUserName
(
userName
))
{
throw
new
ServiceException
(
langPropsService
.
get
(
"userNameInvalidLabel"
));
}
user
.
put
(
User
.
USER_NAME
,
userName
);
final
String
userPassword
=
requestJSONObject
.
optString
(
User
.
USER_PASSWORD
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment