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
12e969be
Unverified
Commit
12e969be
authored
Mar 03, 2019
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎨
#12690
parent
c14b3955
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
4 deletions
+7
-4
src/main/java/org/b3log/solo/service/CommentMgmtService.java
src/main/java/org/b3log/solo/service/CommentMgmtService.java
+4
-3
src/main/resources/lang_en_US.properties
src/main/resources/lang_en_US.properties
+1
-0
src/main/resources/lang_zh_CN.properties
src/main/resources/lang_zh_CN.properties
+1
-0
src/test/java/org/b3log/solo/service/CommentMgmtServiceTestCase.java
...va/org/b3log/solo/service/CommentMgmtServiceTestCase.java
+1
-1
No files found.
src/main/java/org/b3log/solo/service/CommentMgmtService.java
View file @
12e969be
...
@@ -193,7 +193,7 @@ public class CommentMgmtService {
...
@@ -193,7 +193,7 @@ public class CommentMgmtService {
String
commentName
=
requestJSONObject
.
getString
(
Comment
.
COMMENT_NAME
);
String
commentName
=
requestJSONObject
.
getString
(
Comment
.
COMMENT_NAME
);
if
(
MAX_COMMENT_NAME_LENGTH
<
commentName
.
length
()
||
MIN_COMMENT_NAME_LENGTH
>
commentName
.
length
())
{
if
(
MAX_COMMENT_NAME_LENGTH
<
commentName
.
length
()
||
MIN_COMMENT_NAME_LENGTH
>
commentName
.
length
())
{
LOGGER
.
log
(
Level
.
WARN
,
"Comment name is too long[{0}]"
,
commentName
);
LOGGER
.
log
(
Level
.
WARN
,
"Comment name is too long
[{0}]"
,
commentName
);
ret
.
put
(
Keys
.
MSG
,
langPropsService
.
get
(
"nameTooLongLabel"
));
ret
.
put
(
Keys
.
MSG
,
langPropsService
.
get
(
"nameTooLongLabel"
));
return
ret
;
return
ret
;
...
@@ -201,7 +201,8 @@ public class CommentMgmtService {
...
@@ -201,7 +201,8 @@ public class CommentMgmtService {
final
JSONObject
commenter
=
userRepository
.
getByUserName
(
commentName
);
final
JSONObject
commenter
=
userRepository
.
getByUserName
(
commentName
);
if
(
null
==
commenter
)
{
if
(
null
==
commenter
)
{
ret
.
put
(
Keys
.
MSG
,
langPropsService
.
get
(
"nameTooLongLabel"
));
LOGGER
.
log
(
Level
.
WARN
,
"Not found user ["
+
commentName
+
"]"
);
ret
.
put
(
Keys
.
MSG
,
langPropsService
.
get
(
"queryUserFailedLabel"
));
return
ret
;
return
ret
;
}
}
...
@@ -209,7 +210,7 @@ public class CommentMgmtService {
...
@@ -209,7 +210,7 @@ public class CommentMgmtService {
final
String
commentURL
=
requestJSONObject
.
optString
(
Comment
.
COMMENT_URL
);
final
String
commentURL
=
requestJSONObject
.
optString
(
Comment
.
COMMENT_URL
);
if
(!
Strings
.
isURL
(
commentURL
)
||
StringUtils
.
contains
(
commentURL
,
"<"
))
{
if
(!
Strings
.
isURL
(
commentURL
)
||
StringUtils
.
contains
(
commentURL
,
"<"
))
{
LOGGER
.
log
(
Level
.
WARN
,
"Comment URL is invalid[{0}]"
,
commentURL
);
LOGGER
.
log
(
Level
.
WARN
,
"Comment URL is invalid
[{0}]"
,
commentURL
);
ret
.
put
(
Keys
.
MSG
,
langPropsService
.
get
(
"urlInvalidLabel"
));
ret
.
put
(
Keys
.
MSG
,
langPropsService
.
get
(
"urlInvalidLabel"
));
return
ret
;
return
ret
;
...
...
src/main/resources/lang_en_US.properties
View file @
12e969be
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
# Author: Dongxu Wang
# Author: Dongxu Wang
#
#
queryUserFailedLabel
=
Query user info failed
commentContentLabel
=
Content
commentContentLabel
=
Content
cancelLabel
=
Cancel
cancelLabel
=
Cancel
langLabel
=
en_US
langLabel
=
en_US
...
...
src/main/resources/lang_zh_CN.properties
View file @
12e969be
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
# Author: Dongxu Wang
# Author: Dongxu Wang
#
#
queryUserFailedLabel
=
\u
67E5
\u
8BE2
\u7528\u6237\u
4FE1
\u
606F
\u5931\u
8D25
commentContentLabel
=
\u
8BC4
\u
8BBA
\u5185\u
5BB9
commentContentLabel
=
\u
8BC4
\u
8BBA
\u5185\u
5BB9
cancelLabel
=
\u
53D6
\u
6D88
cancelLabel
=
\u
53D6
\u
6D88
langLabel
=
zh_CN
langLabel
=
zh_CN
...
...
src/test/java/org/b3log/solo/service/CommentMgmtServiceTestCase.java
View file @
12e969be
...
@@ -74,7 +74,7 @@ public class CommentMgmtServiceTestCase extends AbstractTestCase {
...
@@ -74,7 +74,7 @@ public class CommentMgmtServiceTestCase extends AbstractTestCase {
final
String
articleId
=
articles
.
get
(
0
).
getString
(
Keys
.
OBJECT_ID
);
final
String
articleId
=
articles
.
get
(
0
).
getString
(
Keys
.
OBJECT_ID
);
requestJSONObject
.
put
(
Keys
.
OBJECT_ID
,
articleId
);
requestJSONObject
.
put
(
Keys
.
OBJECT_ID
,
articleId
);
requestJSONObject
.
put
(
Comment
.
COMMENT_NAME
,
"
comment name
"
);
requestJSONObject
.
put
(
Comment
.
COMMENT_NAME
,
"
Solo
"
);
requestJSONObject
.
put
(
Comment
.
COMMENT_URL
,
"comment URL"
);
requestJSONObject
.
put
(
Comment
.
COMMENT_URL
,
"comment URL"
);
requestJSONObject
.
put
(
Comment
.
COMMENT_CONTENT
,
"comment content"
);
requestJSONObject
.
put
(
Comment
.
COMMENT_CONTENT
,
"comment content"
);
...
...
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