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
d19b6e65
Unverified
Commit
d19b6e65
authored
May 18, 2020
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐛
自定义模板变量解析规则问题 Fix #123
parent
84a427bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
src/main/java/org/b3log/solo/service/DataModelService.java
src/main/java/org/b3log/solo/service/DataModelService.java
+4
-5
No files found.
src/main/java/org/b3log/solo/service/DataModelService.java
View file @
d19b6e65
...
@@ -52,7 +52,7 @@ import static org.b3log.solo.model.Article.ARTICLE_CONTENT;
...
@@ -52,7 +52,7 @@ import static org.b3log.solo.model.Article.ARTICLE_CONTENT;
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 1.7.
0.16, Mar 31
, 2020
* @version 1.7.
1.0, May 18
, 2020
* @since 0.3.1
* @since 0.3.1
*/
*/
@Service
@Service
...
@@ -495,11 +495,10 @@ public class DataModelService {
...
@@ -495,11 +495,10 @@ public class DataModelService {
final
Map
<
String
,
String
>
customVars
=
new
HashMap
<>();
final
Map
<
String
,
String
>
customVars
=
new
HashMap
<>();
final
String
customVarsStr
=
preference
.
optString
(
Option
.
ID_C_CUSTOM_VARS
);
final
String
customVarsStr
=
preference
.
optString
(
Option
.
ID_C_CUSTOM_VARS
);
final
String
[]
customVarsArray
=
customVarsStr
.
split
(
"\\|"
);
final
String
[]
customVarsArray
=
customVarsStr
.
split
(
"\\|"
);
for
(
int
i
=
0
;
i
<
customVarsArray
.
length
;
i
++)
{
for
(
final
String
customVarPair
:
customVarsArray
)
{
final
String
customVarPair
=
customVarsArray
[
i
];
if
(
StringUtils
.
isNotBlank
(
customVarsStr
))
{
if
(
StringUtils
.
isNotBlank
(
customVarsStr
))
{
final
String
customVarKey
=
customVarPair
.
split
(
"="
)[
0
]
;
final
String
customVarKey
=
StringUtils
.
substringBefore
(
customVarPair
,
"="
)
;
final
String
customVarVal
=
customVarPair
.
split
(
"="
)[
1
]
;
final
String
customVarVal
=
StringUtils
.
substringAfter
(
customVarPair
,
"="
)
;
if
(
StringUtils
.
isNotBlank
(
customVarKey
)
&&
StringUtils
.
isNotBlank
(
customVarVal
))
{
if
(
StringUtils
.
isNotBlank
(
customVarKey
)
&&
StringUtils
.
isNotBlank
(
customVarVal
))
{
customVars
.
put
(
customVarKey
,
customVarVal
);
customVars
.
put
(
customVarKey
,
customVarVal
);
}
}
...
...
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