mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Refactoring: Renames RuleBase to Rule
This commit is contained in:
@@ -57,7 +57,7 @@ RuleWithActions::RuleWithActions(
|
||||
Transformations *transformations,
|
||||
std::unique_ptr<std::string> fileName,
|
||||
int lineNumber)
|
||||
: RuleBase(std::move(fileName), lineNumber),
|
||||
: Rule(std::move(fileName), lineNumber),
|
||||
m_rev(""),
|
||||
m_ver(""),
|
||||
m_accuracy(0),
|
||||
|
@@ -135,7 +135,7 @@ int RulesSet::evaluate(int phase, Transaction *t) {
|
||||
for (int i = 0; i < rules->size(); i++) {
|
||||
// FIXME: This is not meant to be here. At the end of this refactoring,
|
||||
// the shared pointer won't be used.
|
||||
std::shared_ptr<RuleBase> rule = rules->at(i);
|
||||
std::shared_ptr<Rule> rule = rules->at(i);
|
||||
if (t->isInsideAMarker() && !rule->isMarker()) {
|
||||
ms_dbg_a(t, 9, "Skipped rule id '" + rule->getReference() \
|
||||
+ "' due to a SecMarker: " + *t->getCurrentMarker());
|
||||
@@ -152,7 +152,7 @@ int RulesSet::evaluate(int phase, Transaction *t) {
|
||||
ms_dbg_a(t, 9, "Skipped rule id '" + rule->getReference() \
|
||||
+ "' as request trough the utilization of an `allow' action.");
|
||||
} else {
|
||||
RuleBase *base = rule.get();
|
||||
Rule *base = rule.get();
|
||||
RuleWithOperator *ruleWithOperator = dynamic_cast<RuleWithOperator *>(base);
|
||||
if (m_exceptions.contains(ruleWithOperator->m_ruleId)) {
|
||||
ms_dbg_a(t, 9, "Skipped rule id '" + rule->getReference() \
|
||||
|
@@ -29,7 +29,7 @@
|
||||
namespace modsecurity {
|
||||
|
||||
|
||||
bool RulesSetPhases::insert(std::shared_ptr<RuleBase> rule) {
|
||||
bool RulesSetPhases::insert(std::shared_ptr<Rule> rule) {
|
||||
if (rule->getPhase() >= modsecurity::Phases::NUMBER_OF_PHASES) {
|
||||
return false;
|
||||
}
|
||||
|
@@ -51,7 +51,7 @@ std::string RunTimeString::evaluate(Transaction *t) {
|
||||
}
|
||||
|
||||
|
||||
std::string RunTimeString::evaluate(Transaction *t, RuleBase *r) {
|
||||
std::string RunTimeString::evaluate(Transaction *t, Rule *r) {
|
||||
std::string s;
|
||||
for (auto &z : m_elements) {
|
||||
if (z->m_string.size() > 0) {
|
||||
|
@@ -49,7 +49,7 @@ class RunTimeString {
|
||||
void appendText(const std::string &text);
|
||||
void appendVar(std::unique_ptr<modsecurity::variables::Variable> var);
|
||||
std::string evaluate(Transaction *t);
|
||||
std::string evaluate(Transaction *t, RuleBase *r);
|
||||
std::string evaluate(Transaction *t, Rule *r);
|
||||
std::string evaluate() {
|
||||
return evaluate(NULL);
|
||||
}
|
||||
|
Reference in New Issue
Block a user