mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Cosmetics: fixed the coding style
This commit is contained in:
parent
90c74beca1
commit
59af8ab842
@ -30,7 +30,7 @@ Redirect::~Redirect() {
|
|||||||
Redirect::Redirect(const std::string& action)
|
Redirect::Redirect(const std::string& action)
|
||||||
: Action(action, RunTimeOnlyIfMatchKind),
|
: Action(action, RunTimeOnlyIfMatchKind),
|
||||||
m_url(action) {
|
m_url(action) {
|
||||||
//m_url = m_url.erase(0, 9);
|
// m_url = m_url.erase(0, 9);
|
||||||
if (m_url.at(0) == '\'') {
|
if (m_url.at(0) == '\'') {
|
||||||
m_url.erase(0, 1);
|
m_url.erase(0, 1);
|
||||||
if (m_url.size() > 0) {
|
if (m_url.size() > 0) {
|
||||||
|
@ -102,7 +102,8 @@ void SetVar::dump() {
|
|||||||
bool SetVar::evaluate(Rule *rule, Assay *assay) {
|
bool SetVar::evaluate(Rule *rule, Assay *assay) {
|
||||||
std::string targetValue;
|
std::string targetValue;
|
||||||
int value = 0;
|
int value = 0;
|
||||||
std::string variableNameExpanded = MacroExpansion::expand(variableName, assay);
|
std::string variableNameExpanded = MacroExpansion::expand(variableName,
|
||||||
|
assay);
|
||||||
std::string resolvedPre = MacroExpansion::expand(predicate, assay);
|
std::string resolvedPre = MacroExpansion::expand(predicate, assay);
|
||||||
|
|
||||||
if (operation == setOperation) {
|
if (operation == setOperation) {
|
||||||
|
@ -33,7 +33,7 @@ class IpMatch : public Operator {
|
|||||||
|
|
||||||
bool evaluate(Assay *assay, const std::string &input) override;
|
bool evaluate(Assay *assay, const std::string &input) override;
|
||||||
|
|
||||||
virtual bool init(const std::string &file, const char **error) override;
|
bool init(const std::string &file, const char **error) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Utils::IpTree m_tree;
|
Utils::IpTree m_tree;
|
||||||
|
@ -39,7 +39,7 @@ class Pm : public Operator {
|
|||||||
const std::string& to);
|
const std::string& to);
|
||||||
bool evaluate(Assay *assay, const std::string &input) override;
|
bool evaluate(Assay *assay, const std::string &input) override;
|
||||||
|
|
||||||
virtual bool init(const std::string &file, const char **error) override;
|
bool init(const std::string &file, const char **error) override;
|
||||||
void postOrderTraversal(acmp_btree_node_t *node);
|
void postOrderTraversal(acmp_btree_node_t *node);
|
||||||
|
|
||||||
std::list<std::string> matched;
|
std::list<std::string> matched;
|
||||||
|
@ -107,7 +107,8 @@ Rule::Rule(Operator *_op,
|
|||||||
if (a->action_kind == Action::ConfigurationKind) {
|
if (a->action_kind == Action::ConfigurationKind) {
|
||||||
actions_conf.push_back(a);
|
actions_conf.push_back(a);
|
||||||
a->evaluate(this, NULL);
|
a->evaluate(this, NULL);
|
||||||
} else if (a->action_kind == Action::RunTimeBeforeMatchAttemptKind) {
|
} else if (a->action_kind
|
||||||
|
== Action::RunTimeBeforeMatchAttemptKind) {
|
||||||
actions_runtime_pre.push_back(a);
|
actions_runtime_pre.push_back(a);
|
||||||
} else if (a->action_kind == Action::RunTimeOnlyIfMatchKind) {
|
} else if (a->action_kind == Action::RunTimeOnlyIfMatchKind) {
|
||||||
actions_runtime_pos.push_back(a);
|
actions_runtime_pos.push_back(a);
|
||||||
|
@ -35,8 +35,7 @@ class Rule {
|
|||||||
std::vector<Variables::Variable *> *_variables,
|
std::vector<Variables::Variable *> *_variables,
|
||||||
std::vector<actions::Action *> *_actions,
|
std::vector<actions::Action *> *_actions,
|
||||||
std::string fileName,
|
std::string fileName,
|
||||||
int lineNumber
|
int lineNumber);
|
||||||
);
|
|
||||||
explicit Rule(std::string marker);
|
explicit Rule(std::string marker);
|
||||||
|
|
||||||
~Rule();
|
~Rule();
|
||||||
|
@ -1023,8 +1023,7 @@ std::string toHexIfNeeded(const std::string &str) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::vector<std::string> expandEnv(const std::string& var, int flags)
|
std::vector<std::string> expandEnv(const std::string& var, int flags) {
|
||||||
{
|
|
||||||
std::vector<std::string> vars;
|
std::vector<std::string> vars;
|
||||||
|
|
||||||
wordexp_t p;
|
wordexp_t p;
|
||||||
@ -1052,7 +1051,8 @@ std::string get_path(const std::string& file) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string find_resource(const std::string& resource, const std::string& config) {
|
std::string find_resource(const std::string& resource,
|
||||||
|
const std::string& config) {
|
||||||
std::ifstream *iss = NULL;
|
std::ifstream *iss = NULL;
|
||||||
|
|
||||||
// Trying absolute or relative to the current dir.
|
// Trying absolute or relative to the current dir.
|
||||||
|
@ -52,7 +52,8 @@ int regex_search(const std::string& s, SMatch *match,
|
|||||||
s.size(), 0, 0, ovector, OVECCOUNT) > 0;
|
s.size(), 0, 0, ovector, OVECCOUNT) > 0;
|
||||||
|
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
match->match = std::string(s, ovector[ret-1], ovector[ret] - ovector[ret-1]);
|
match->match = std::string(s, ovector[ret-1],
|
||||||
|
ovector[ret] - ovector[ret-1]);
|
||||||
match->size_ = ret;
|
match->size_ = ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user