Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo
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
Commits
733b55ab
Commit
733b55ab
authored
Dec 19, 2015
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
5dd39fe7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
src/main/java/org/b3log/solo/Starter.java
src/main/java/org/b3log/solo/Starter.java
+5
-3
src/main/java/org/b3log/solo/service/CommentMgmtService.java
src/main/java/org/b3log/solo/service/CommentMgmtService.java
+1
-2
src/main/java/org/b3log/solo/service/UpgradeService.java
src/main/java/org/b3log/solo/service/UpgradeService.java
+1
-1
No files found.
src/main/java/org/b3log/solo/Starter.java
View file @
733b55ab
...
...
@@ -94,7 +94,7 @@ public final class Starter {
final
Option
staticServerPortOpt
=
Option
.
builder
(
"ssp"
).
longOpt
(
"static_server_port"
).
argName
(
"STATIC_SERVER_PORT"
)
.
hasArg
().
desc
(
"browser visit static resource port, default is 8080"
).
build
();
options
.
addOption
(
staticServerPortOpt
);
final
Option
runtimeModeOpt
=
Option
.
builder
(
"rm"
).
longOpt
(
"runtime_mode"
).
argName
(
"RUNTIME_MODE"
)
.
hasArg
().
desc
(
"runtime mode (DEVELOPMENT/PRODUCTION), default is DEVELOPMENT"
).
build
();
options
.
addOption
(
runtimeModeOpt
);
...
...
@@ -142,8 +142,10 @@ public final class Starter {
String
staticServerPort
=
commandLine
.
getOptionValue
(
"static_server_port"
);
Latkes
.
setStaticServerPort
(
staticServerPort
);
String
runtimeMode
=
commandLine
.
getOptionValue
(
"runtime_mode"
);
Latkes
.
setRuntimeMode
(
RuntimeMode
.
valueOf
(
runtimeMode
));
if
(
null
!=
runtimeMode
)
{
Latkes
.
setRuntimeMode
(
RuntimeMode
.
valueOf
(
runtimeMode
));
}
logger
.
info
(
"Standalone mode, see [https://github.com/b3log/solo/wiki/standalone_mode] for more details."
);
Latkes
.
initRuntimeEnv
();
...
...
src/main/java/org/b3log/solo/service/CommentMgmtService.java
View file @
733b55ab
...
...
@@ -341,7 +341,7 @@ public class CommentMgmtService {
return
ret
;
}
String
commentContent
=
requestJSONObject
.
optString
(
Comment
.
COMMENT_CONTENT
)
.
replaceAll
(
"\\n"
,
"<br/>"
)
;
String
commentContent
=
requestJSONObject
.
optString
(
Comment
.
COMMENT_CONTENT
);
if
(
MAX_COMMENT_CONTENT_LENGTH
<
commentContent
.
length
()
||
MIN_COMMENT_CONTENT_LENGTH
>
commentContent
.
length
())
{
LOGGER
.
log
(
Level
.
WARN
,
"Comment conent length is invalid[{0}]"
,
commentContent
.
length
());
...
...
@@ -356,7 +356,6 @@ public class CommentMgmtService {
commentName
=
Jsoup
.
clean
(
commentName
,
Whitelist
.
none
());
requestJSONObject
.
put
(
Comment
.
COMMENT_NAME
,
commentName
);
commentContent
=
commentContent
.
replaceAll
(
"\\n"
,
"<br/>\n"
);
// content Markdown & XSS process
commentContent
=
Markdowns
.
toHTML
(
commentContent
);
commentContent
=
Jsoup
.
clean
(
commentContent
,
Whitelist
.
relaxed
());
...
...
src/main/java/org/b3log/solo/service/UpgradeService.java
View file @
733b55ab
...
...
@@ -193,7 +193,7 @@ public class UpgradeService {
comment
.
put
(
Comment
.
COMMENT_NAME
,
name
);
String
content
=
comment
.
optString
(
Comment
.
COMMENT_CONTENT
);
content
=
StringEscapeUtils
.
unescapeHtml
(
content
).
replaceAll
(
"_esc_enter_88250_"
,
"
<br/>
"
);
content
=
StringEscapeUtils
.
unescapeHtml
(
content
).
replaceAll
(
"_esc_enter_88250_"
,
"
\n\n
"
);
content
=
Markdowns
.
toHTML
(
content
);
content
=
Jsoup
.
clean
(
content
,
Whitelist
.
relaxed
());
comment
.
put
(
Comment
.
COMMENT_CONTENT
,
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