mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-16 01:22:18 +03:00
Cosmetics: Defining a type for RuleId
This commit is contained in:
@@ -420,7 +420,7 @@ class RuleWithActions : public Rule {
|
||||
return dst;
|
||||
}
|
||||
|
||||
inline int64_t getId() const { return m_ruleId; }
|
||||
inline RuleId getId() const { return m_ruleId; }
|
||||
void setId(int id) {
|
||||
m_ruleId = id;
|
||||
}
|
||||
@@ -455,7 +455,7 @@ class RuleWithActions : public Rule {
|
||||
}
|
||||
|
||||
private:
|
||||
int64_t m_ruleId;
|
||||
RuleId m_ruleId;
|
||||
|
||||
std::shared_ptr<RuleWithActions> m_chainedRuleChild;
|
||||
RuleWithActions *m_chainedRuleParent;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
namespace modsecurity {
|
||||
|
||||
|
||||
int Rules::append(Rules *from, const std::vector<int64_t> &ids, std::ostringstream *err) {
|
||||
int Rules::append(Rules *from, const std::vector<RuleId> &ids, std::ostringstream *err) {
|
||||
size_t j = 0;
|
||||
for (; j < from->size(); j++) {
|
||||
RuleWithActions *rule = dynamic_cast<RuleWithActions*>(from->at(j).get());
|
||||
@@ -42,7 +42,7 @@ bool Rules::insert(const std::shared_ptr<Rule> &rule) {
|
||||
}
|
||||
|
||||
|
||||
bool Rules::insert(std::shared_ptr<Rule> rule, const std::vector<int64_t> *ids, std::ostringstream *err) {
|
||||
bool Rules::insert(std::shared_ptr<Rule> rule, const std::vector<RuleId> *ids, std::ostringstream *err) {
|
||||
RuleWithActions*r = dynamic_cast<RuleWithActions*>(rule.get());
|
||||
if (r && ids != nullptr
|
||||
&& std::binary_search(ids->begin(), ids->end(), r->getId())) {
|
||||
|
||||
Reference in New Issue
Block a user