Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
cms_sys
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
西魏
cms_sys
Commits
48e10590
Commit
48e10590
authored
Sep 22, 2020
by
sgjj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复搜索空异常
parent
aba427d3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
MCmsAction.java
src/main/java/net/mingsoft/cms/action/web/MCmsAction.java
+5
-3
No files found.
src/main/java/net/mingsoft/cms/action/web/MCmsAction.java
View file @
48e10590
...
@@ -343,11 +343,11 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
...
@@ -343,11 +343,11 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
if
(
field
!=
null
)
{
if
(
field
!=
null
)
{
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
field
.
entrySet
())
{
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
field
.
entrySet
())
{
if
(
entry
!=
null
)
{
if
(
entry
!=
null
)
{
String
value
=
entry
.
getValue
().
toString
().
replaceAll
(
"('|\"|\\\\)"
,
"\\\\$1"
);
// 处理由get方法请求中文乱码问题
if
(
ObjectUtil
.
isNull
(
entry
.
getValue
()))
{
value
=
clearXss
(
value
);
if
(
ObjectUtil
.
isNull
(
value
))
{
continue
;
continue
;
}
}
String
value
=
entry
.
getValue
().
toString
().
replaceAll
(
"('|\"|\\\\)"
,
"\\\\$1"
);
// 处理由get方法请求中文乱码问题
value
=
clearXss
(
value
);
if
(
request
.
getMethod
().
equals
(
RequestMethod
.
GET
))
{
// 如果是get方法需要将请求地址参数转码
if
(
request
.
getMethod
().
equals
(
RequestMethod
.
GET
))
{
// 如果是get方法需要将请求地址参数转码
try
{
try
{
value
=
new
String
(
value
.
getBytes
(
"ISO-8859-1"
),
Const
.
UTF8
);
value
=
new
String
(
value
.
getBytes
(
"ISO-8859-1"
),
Const
.
UTF8
);
...
@@ -383,11 +383,13 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
...
@@ -383,11 +383,13 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
StringBuilder
urlParams
=
new
StringBuilder
();
StringBuilder
urlParams
=
new
StringBuilder
();
searchMap
.
forEach
((
k
,
v
)->{
searchMap
.
forEach
((
k
,
v
)->{
//sql注入过滤
//sql注入过滤
if
(
v
!=
null
){
searchMap
.
put
(
k
,
v
.
toString
().
replaceAll
(
"('|\"|\\\\)"
,
"\\\\$1"
));
searchMap
.
put
(
k
,
v
.
toString
().
replaceAll
(
"('|\"|\\\\)"
,
"\\\\$1"
));
searchMap
.
put
(
k
,
clearXss
(
searchMap
.
get
(
k
).
toString
()));
searchMap
.
put
(
k
,
clearXss
(
searchMap
.
get
(
k
).
toString
()));
if
(!
ParserUtil
.
SIZE
.
equals
(
k
)&&!
ParserUtil
.
PAGE_NO
.
equals
(
k
)){
if
(!
ParserUtil
.
SIZE
.
equals
(
k
)&&!
ParserUtil
.
PAGE_NO
.
equals
(
k
)){
urlParams
.
append
(
k
).
append
(
"="
).
append
(
searchMap
.
get
(
k
)).
append
(
"&"
);
urlParams
.
append
(
k
).
append
(
"="
).
append
(
searchMap
.
get
(
k
)).
append
(
"&"
);
}
}
}
});
});
//查询数量
//查询数量
...
...
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