Refactoring on the operators: negation is now being handled globally

Other minors changes were also made, including adding the prefix `m_'
to all the members of the class.
This commit is contained in:
Felipe Zimmerle
2016-10-19 10:23:03 -03:00
parent 28a44b966a
commit 8757840bc3
36 changed files with 88 additions and 138 deletions

View File

@@ -93,7 +93,7 @@ bool VerifyCC::init(const std::string &param2, std::string *error) {
const char *errptr = NULL;
int erroffset = 0;
m_pc = pcre_compile(param.c_str(), PCRE_DOTALL|PCRE_MULTILINE,
m_pc = pcre_compile(m_param.c_str(), PCRE_DOTALL|PCRE_MULTILINE,
&errptr, &erroffset, NULL);
if (m_pc == NULL) {
error->assign(errptr);
@@ -143,7 +143,7 @@ bool VerifyCC::evaluate(Transaction *transaction, const std::string &i) {
if (is_cc) {
if (transaction) {
#ifndef NO_LOGS
transaction->debug(9, "CC# match \"" + param +
transaction->debug(9, "CC# match \"" + m_param +
"\" at " + i + ". [offset " +
std::to_string(offset) + "]");
#endif
@@ -159,3 +159,4 @@ bool VerifyCC::evaluate(Transaction *transaction, const std::string &i) {
} // namespace operators
} // namespace modsecurity