Adds macro expansion for all operators

This commit is contained in:
Felipe Zimmerle
2015-09-16 11:25:07 -03:00
parent 320bcde89e
commit 9d60dc6df8
15 changed files with 49 additions and 19 deletions

View File

@@ -19,6 +19,7 @@
#include <list>
#include "operators/operator.h"
#include "src/macro_expansion.h"
namespace ModSecurity {
namespace operators {
@@ -28,8 +29,8 @@ namespace operators {
bool Rx::evaluate(Assay *assay, const std::string& input) {
SMatch match;
std::string i = input;
if (regex_search(i, &match, m_re) && match.size() >= 1) {
Regex re(MacroExpansion::expand(param, assay));
if (regex_search(input, &match, re) && match.size() >= 1) {
this->matched.push_back(match.match);
return true;
}