mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-13 21:36:00 +03:00
Fix the regression tests as reported on #1142
This commit is contained in:
parent
3062ff2aa5
commit
d0e0002283
@ -26,7 +26,7 @@ bool Contains::evaluate(Transaction *transaction, const std::string &input) {
|
||||
std::string p = MacroExpansion::expand(param, transaction);
|
||||
bool contains = input.find(p) != std::string::npos;
|
||||
|
||||
if (contains) {
|
||||
if (contains && transaction) {
|
||||
transaction->m_matched.push_back(p);
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ bool Pm::evaluate(Transaction *transaction, const std::string &input) {
|
||||
const char *match = NULL;
|
||||
|
||||
rc = acmp_process_quick(&pt, &match, input.c_str(), input.length());
|
||||
if (rc == 1) {
|
||||
if (rc == 1 && transaction) {
|
||||
transaction->m_matched.push_back(std::string(match));
|
||||
}
|
||||
|
||||
|
@ -29,8 +29,14 @@ namespace operators {
|
||||
bool Rx::evaluate(Transaction *transaction, const std::string& input) {
|
||||
SMatch match;
|
||||
|
||||
if (m_param.empty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (regex_search(input, &match, *m_re) && match.size() >= 1) {
|
||||
transaction->m_matched.push_back(match.match);
|
||||
if (transaction) {
|
||||
transaction->m_matched.push_back(match.match);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user