mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-17 01:36:08 +03:00
Removes slash from REQUEST_BASENAME
This commit is contained in:
parent
293a849668
commit
d3a4ec760c
@ -406,9 +406,9 @@ int Transaction::processURI(const char *uri, const char *method,
|
|||||||
m_collections.store("REQUEST_FILENAME", path_info);
|
m_collections.store("REQUEST_FILENAME", path_info);
|
||||||
|
|
||||||
size_t offset = path_info.find_last_of("/\\");
|
size_t offset = path_info.find_last_of("/\\");
|
||||||
if (offset != std::string::npos) {
|
if (offset != std::string::npos && path_info.length() > offset + 1) {
|
||||||
std::string basename = std::string(path_info, offset,
|
std::string basename = std::string(path_info, offset + 1,
|
||||||
path_info.length() - offset);
|
path_info.length() - (offset + 1));
|
||||||
m_collections.store("REQUEST_BASENAME", basename);
|
m_collections.store("REQUEST_BASENAME", basename);
|
||||||
}
|
}
|
||||||
m_collections.store("REQUEST_METHOD", method);
|
m_collections.store("REQUEST_METHOD", method);
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"expected":{
|
"expected":{
|
||||||
"debug_log":"Target value: \"/login.php\" \\(Variable: REQUEST_BASENAME\\)"
|
"debug_log":"Target value: \"login.php\" \\(Variable: REQUEST_BASENAME\\)"
|
||||||
},
|
},
|
||||||
"rules":[
|
"rules":[
|
||||||
"SecRuleEngine On",
|
"SecRuleEngine On",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user