mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Adds checks for the NO_LOGS definition and improved the vars resolution time
This commit is contained in:
@@ -77,29 +77,37 @@ bool ValidateUrlEncoding::evaluate(Assay *assay, const std::string &input) {
|
||||
case 1 :
|
||||
/* Encoding is valid */
|
||||
if (assay) {
|
||||
#ifndef NO_LOGS
|
||||
assay->debug(7, "Valid URL Encoding at '" +input + "'");
|
||||
#endif
|
||||
}
|
||||
res = false;
|
||||
break;
|
||||
case -2 :
|
||||
if (assay) {
|
||||
#ifndef NO_LOGS
|
||||
assay->debug(7, "Invalid URL Encoding: Non-hexadecimal "
|
||||
"digits used at '" + input + "'");
|
||||
#endif
|
||||
}
|
||||
res = true; /* Invalid match. */
|
||||
break;
|
||||
case -3 :
|
||||
if (assay) {
|
||||
#ifndef NO_LOGS
|
||||
assay->debug(7, "Invalid URL Encoding: Not enough characters "
|
||||
"at the end of input at '" + input + "'");
|
||||
#endif
|
||||
}
|
||||
res = true; /* Invalid match. */
|
||||
break;
|
||||
case -1 :
|
||||
default :
|
||||
if (assay) {
|
||||
#ifndef NO_LOGS
|
||||
assay->debug(7, "Invalid URL Encoding: Internal Error (rc = " +
|
||||
std::to_string(rc) + ") at '" + input + "'");
|
||||
#endif
|
||||
}
|
||||
res = true;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user