Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
MCMS
Commits
0ca41ed7
Commit
0ca41ed7
authored
May 11, 2020
by
sgjj
Browse files
sql注入
parent
32124236
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/net/mingsoft/cms/action/web/MCmsAction.java
View file @
0ca41ed7
...
...
@@ -447,6 +447,11 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
this
.
outString
(
response
,
content
);
}
/**
* sql语句检测,存在返回true
* @param str
* @return
*/
public
static
boolean
sqlFilter
(
String
str
){
Pattern
pattern
=
Pattern
.
compile
(
"\\b(and|exec|insert|select|drop|grant|alter|delete|update|count|chr|mid|master|truncate|char|declare|or)\\b|(\\*|;|\\+|'|%)"
);
Matcher
matcher
=
pattern
.
matcher
(
str
);
...
...
Write
Preview
Supports
Markdown
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