diff --git a/src/actions/accuracy.h b/src/actions/accuracy.h index 6e78a422..a2af47af 100644 --- a/src/actions/accuracy.h +++ b/src/actions/accuracy.h @@ -29,7 +29,7 @@ namespace actions { class Accuracy : public Action { public: - explicit Accuracy(std::string action) + explicit Accuracy(const std::string &action) : Action(action, ConfigurationKind), m_accuracy(0) { } diff --git a/src/actions/audit_log.h b/src/actions/audit_log.h index f63198f0..6e3ecbd0 100644 --- a/src/actions/audit_log.h +++ b/src/actions/audit_log.h @@ -32,7 +32,7 @@ namespace actions { class AuditLog : public Action { public: - explicit AuditLog(std::string action) + explicit AuditLog(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } bool evaluate(Rule *rule, Transaction *transaction, diff --git a/src/actions/block.h b/src/actions/block.h index ecd73d8c..05f39f92 100644 --- a/src/actions/block.h +++ b/src/actions/block.h @@ -33,7 +33,7 @@ namespace actions { class Block : public Action { public: - explicit Block(std::string action) : Action(action) { } + explicit Block(const std::string &action) : Action(action) { } bool evaluate(Rule *rule, Transaction *transaction, std::shared_ptr rm) override; diff --git a/src/actions/capture.h b/src/actions/capture.h index be3cbae1..ae99543f 100644 --- a/src/actions/capture.h +++ b/src/actions/capture.h @@ -28,7 +28,7 @@ namespace actions { class Capture : public Action { public: - explicit Capture(std::string action) + explicit Capture(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } bool evaluate(Rule *rule, Transaction *transaction) override; diff --git a/src/actions/chain.h b/src/actions/chain.h index 64962518..42af24fc 100644 --- a/src/actions/chain.h +++ b/src/actions/chain.h @@ -32,7 +32,7 @@ namespace actions { class Chain : public Action { public: - explicit Chain(std::string action) + explicit Chain(const std::string &action) : Action(action, ConfigurationKind) { } bool evaluate(Rule *rule, Transaction *transaction) override; diff --git a/src/actions/ctl/audit_log_parts.h b/src/actions/ctl/audit_log_parts.h index e1d3546c..dae40191 100644 --- a/src/actions/ctl/audit_log_parts.h +++ b/src/actions/ctl/audit_log_parts.h @@ -28,7 +28,7 @@ namespace ctl { class AuditLogParts : public Action { public: - explicit AuditLogParts(std::string action) + explicit AuditLogParts(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind), mPartsAction(0), mParts("") { } diff --git a/src/actions/ctl/request_body_access.h b/src/actions/ctl/request_body_access.h index 8f2f05e9..aca57854 100644 --- a/src/actions/ctl/request_body_access.h +++ b/src/actions/ctl/request_body_access.h @@ -29,7 +29,7 @@ namespace ctl { class RequestBodyAccess : public Action { public: - explicit RequestBodyAccess(std::string action) + explicit RequestBodyAccess(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind), m_request_body_access(false) { } diff --git a/src/actions/ctl/request_body_processor_json.h b/src/actions/ctl/request_body_processor_json.h index dca4d608..4cd76dc4 100644 --- a/src/actions/ctl/request_body_processor_json.h +++ b/src/actions/ctl/request_body_processor_json.h @@ -28,7 +28,7 @@ namespace ctl { class RequestBodyProcessorJSON : public Action { public: - explicit RequestBodyProcessorJSON(std::string action) + explicit RequestBodyProcessorJSON(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } bool evaluate(Rule *rule, Transaction *transaction) override; diff --git a/src/actions/ctl/request_body_processor_urlencoded.h b/src/actions/ctl/request_body_processor_urlencoded.h index 920b0553..a5a849ed 100644 --- a/src/actions/ctl/request_body_processor_urlencoded.h +++ b/src/actions/ctl/request_body_processor_urlencoded.h @@ -28,7 +28,7 @@ namespace ctl { class RequestBodyProcessorURLENCODED : public Action { public: - explicit RequestBodyProcessorURLENCODED(std::string action) + explicit RequestBodyProcessorURLENCODED(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } bool evaluate(Rule *rule, Transaction *transaction) override; diff --git a/src/actions/ctl/request_body_processor_xml.h b/src/actions/ctl/request_body_processor_xml.h index 449eec12..bb8f00b5 100644 --- a/src/actions/ctl/request_body_processor_xml.h +++ b/src/actions/ctl/request_body_processor_xml.h @@ -28,7 +28,7 @@ namespace ctl { class RequestBodyProcessorXML : public Action { public: - explicit RequestBodyProcessorXML(std::string action) + explicit RequestBodyProcessorXML(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } bool evaluate(Rule *rule, Transaction *transaction) override; diff --git a/src/actions/ctl/rule_engine.h b/src/actions/ctl/rule_engine.h index 93ef894c..e8a862d6 100644 --- a/src/actions/ctl/rule_engine.h +++ b/src/actions/ctl/rule_engine.h @@ -30,7 +30,7 @@ namespace ctl { class RuleEngine : public Action { public: - explicit RuleEngine(std::string action) + explicit RuleEngine(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind), m_ruleEngine(RulesProperties::PropertyNotSetRuleEngine) { } diff --git a/src/actions/ctl/rule_remove_by_id.h b/src/actions/ctl/rule_remove_by_id.h index efb0dc85..2347d4f3 100644 --- a/src/actions/ctl/rule_remove_by_id.h +++ b/src/actions/ctl/rule_remove_by_id.h @@ -29,7 +29,7 @@ namespace ctl { class RuleRemoveById : public Action { public: - explicit RuleRemoveById(std::string action) + explicit RuleRemoveById(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } bool init(std::string *error) override; diff --git a/src/actions/ctl/rule_remove_by_tag.h b/src/actions/ctl/rule_remove_by_tag.h index 6f977883..1e5241a4 100644 --- a/src/actions/ctl/rule_remove_by_tag.h +++ b/src/actions/ctl/rule_remove_by_tag.h @@ -29,7 +29,7 @@ namespace ctl { class RuleRemoveByTag : public Action { public: - explicit RuleRemoveByTag(std::string action) + explicit RuleRemoveByTag(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind), m_tag("") { } diff --git a/src/actions/ctl/rule_remove_target_by_id.h b/src/actions/ctl/rule_remove_target_by_id.h index 03941f4a..489f8fcd 100644 --- a/src/actions/ctl/rule_remove_target_by_id.h +++ b/src/actions/ctl/rule_remove_target_by_id.h @@ -29,7 +29,7 @@ namespace ctl { class RuleRemoveTargetById : public Action { public: - explicit RuleRemoveTargetById(std::string action) + explicit RuleRemoveTargetById(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind), m_id(0), m_target("") { } diff --git a/src/actions/ctl/rule_remove_target_by_tag.h b/src/actions/ctl/rule_remove_target_by_tag.h index 3acf4c8b..97f65c0d 100644 --- a/src/actions/ctl/rule_remove_target_by_tag.h +++ b/src/actions/ctl/rule_remove_target_by_tag.h @@ -29,7 +29,7 @@ namespace ctl { class RuleRemoveTargetByTag : public Action { public: - explicit RuleRemoveTargetByTag(std::string action) + explicit RuleRemoveTargetByTag(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } bool init(std::string *error) override; diff --git a/src/actions/data/status.h b/src/actions/data/status.h index 8a0232fd..7e14e1ff 100644 --- a/src/actions/data/status.h +++ b/src/actions/data/status.h @@ -33,7 +33,7 @@ namespace data { class Status : public Action { public: - explicit Status(std::string action) : Action(action, 2), + explicit Status(const std::string &action) : Action(action, 2), m_status(0) { } bool init(std::string *error) override; diff --git a/src/actions/disruptive/allow.h b/src/actions/disruptive/allow.h index 220f94fa..df5dd841 100644 --- a/src/actions/disruptive/allow.h +++ b/src/actions/disruptive/allow.h @@ -53,7 +53,7 @@ enum AllowType : int { class Allow : public Action { public: - explicit Allow(std::string action) + explicit Allow(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind), m_allowType(NoneAllowType) { } diff --git a/src/actions/disruptive/deny.h b/src/actions/disruptive/deny.h index 0d8871ec..9dadfe0f 100644 --- a/src/actions/disruptive/deny.h +++ b/src/actions/disruptive/deny.h @@ -31,7 +31,7 @@ namespace disruptive { class Deny : public Action { public: - explicit Deny(std::string action) : Action(action) { } + explicit Deny(const std::string &action) : Action(action) { } bool evaluate(Rule *rule, Transaction *transaction, std::shared_ptr rm) override; diff --git a/src/actions/disruptive/drop.h b/src/actions/disruptive/drop.h index fc96aeeb..530c3548 100644 --- a/src/actions/disruptive/drop.h +++ b/src/actions/disruptive/drop.h @@ -31,7 +31,7 @@ namespace disruptive { class Drop : public Action { public: - explicit Drop(std::string action) : Action(action) { } + explicit Drop(const std::string &action) : Action(action) { } bool evaluate(Rule *rule, Transaction *transaction, std::shared_ptr rm) override; diff --git a/src/actions/disruptive/pass.h b/src/actions/disruptive/pass.h index 50f8fd53..fe8fec92 100644 --- a/src/actions/disruptive/pass.h +++ b/src/actions/disruptive/pass.h @@ -29,7 +29,7 @@ namespace disruptive { class Pass : public Action { public: - explicit Pass(std::string action) : Action(action) { } + explicit Pass(const std::string &action) : Action(action) { } bool evaluate(Rule *rule, Transaction *transaction, std::shared_ptr rm) override; diff --git a/src/actions/disruptive/redirect.h b/src/actions/disruptive/redirect.h index b982a86b..b4973dff 100644 --- a/src/actions/disruptive/redirect.h +++ b/src/actions/disruptive/redirect.h @@ -38,10 +38,12 @@ class Redirect : public Action { public: explicit Redirect(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind), - m_status(0) { } + m_status(0), + m_string(nullptr) { } explicit Redirect(std::unique_ptr z) : Action("redirert", RunTimeOnlyIfMatchKind), + m_status(0), m_string(std::move(z)) { } bool evaluate(Rule *rule, Transaction *transaction, diff --git a/src/actions/exec.h b/src/actions/exec.h index cffffb79..b337c9eb 100644 --- a/src/actions/exec.h +++ b/src/actions/exec.h @@ -30,7 +30,7 @@ namespace actions { class Exec : public Action { public: - explicit Exec(std::string action) + explicit Exec(const std::string &action) : Action(action), m_script("") { } diff --git a/src/actions/init_col.h b/src/actions/init_col.h index bd06bf6f..e05186bb 100644 --- a/src/actions/init_col.h +++ b/src/actions/init_col.h @@ -32,9 +32,9 @@ namespace actions { class InitCol : public Action { public: - explicit InitCol(std::string action) : Action(action) { } + explicit InitCol(const std::string &action) : Action(action) { } - InitCol(std::string action, std::unique_ptr z) + InitCol(const std::string &action, std::unique_ptr z) : Action(action, RunTimeOnlyIfMatchKind), m_string(std::move(z)) { } diff --git a/src/actions/log.h b/src/actions/log.h index 1d7262f0..c917bc7a 100644 --- a/src/actions/log.h +++ b/src/actions/log.h @@ -30,7 +30,7 @@ namespace actions { class Log : public Action { public: - explicit Log(std::string action) + explicit Log(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } bool evaluate(Rule *rule, Transaction *transaction, diff --git a/src/actions/log_data.h b/src/actions/log_data.h index 80056370..d0032cc8 100644 --- a/src/actions/log_data.h +++ b/src/actions/log_data.h @@ -32,7 +32,7 @@ namespace actions { class LogData : public Action { public: - explicit LogData(std::string action) + explicit LogData(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } explicit LogData(std::unique_ptr z) diff --git a/src/actions/maturity.h b/src/actions/maturity.h index 6227fada..b6daac1f 100644 --- a/src/actions/maturity.h +++ b/src/actions/maturity.h @@ -29,7 +29,7 @@ namespace actions { class Maturity : public Action { public: - explicit Maturity(std::string action) + explicit Maturity(const std::string &action) : Action(action, ConfigurationKind), m_maturity(0) { } diff --git a/src/actions/msg.h b/src/actions/msg.h index 6206ca17..16e4627c 100644 --- a/src/actions/msg.h +++ b/src/actions/msg.h @@ -33,7 +33,7 @@ namespace actions { class Msg : public Action { public: - explicit Msg(std::string action) + explicit Msg(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } explicit Msg(std::unique_ptr z) diff --git a/src/actions/multi_match.h b/src/actions/multi_match.h index 6f74a414..1bcf77c1 100644 --- a/src/actions/multi_match.h +++ b/src/actions/multi_match.h @@ -32,7 +32,7 @@ namespace actions { class MultiMatch : public Action { public: - explicit MultiMatch(std::string action) + explicit MultiMatch(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } bool evaluate(Rule *rule, Transaction *transaction) override; diff --git a/src/actions/no_audit_log.h b/src/actions/no_audit_log.h index d0543a9f..23de0598 100644 --- a/src/actions/no_audit_log.h +++ b/src/actions/no_audit_log.h @@ -32,7 +32,7 @@ namespace actions { class NoAuditLog : public Action { public: - explicit NoAuditLog(std::string action) + explicit NoAuditLog(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } bool evaluate(Rule *rule, Transaction *transaction, diff --git a/src/actions/no_log.h b/src/actions/no_log.h index 9d4878be..f8ae51be 100644 --- a/src/actions/no_log.h +++ b/src/actions/no_log.h @@ -30,7 +30,7 @@ namespace actions { class NoLog : public Action { public: - explicit NoLog(std::string action) + explicit NoLog(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } bool evaluate(Rule *rule, Transaction *transaction, diff --git a/src/actions/phase.h b/src/actions/phase.h index 99f0176f..81f6abf7 100644 --- a/src/actions/phase.h +++ b/src/actions/phase.h @@ -32,7 +32,7 @@ namespace actions { class Phase : public Action { public: - explicit Phase(std::string action) : Action(action, ConfigurationKind), + explicit Phase(const std::string &action) : Action(action, ConfigurationKind), m_phase(0), m_secRulesPhase(0) { } diff --git a/src/actions/rev.h b/src/actions/rev.h index 052085b0..64e57faf 100644 --- a/src/actions/rev.h +++ b/src/actions/rev.h @@ -29,7 +29,7 @@ namespace actions { class Rev : public Action { public: - explicit Rev(std::string action) : Action(action, ConfigurationKind) { } + explicit Rev(const std::string &action) : Action(action, ConfigurationKind) { } bool evaluate(Rule *rule, Transaction *transaction) override; bool init(std::string *error) override; diff --git a/src/actions/rule_id.h b/src/actions/rule_id.h index b327d2a2..d2ff0981 100644 --- a/src/actions/rule_id.h +++ b/src/actions/rule_id.h @@ -32,7 +32,7 @@ namespace actions { class RuleId : public Action { public: - explicit RuleId(std::string action) + explicit RuleId(const std::string &action) : Action(action, ConfigurationKind), m_ruleId(0) { } diff --git a/src/actions/set_env.h b/src/actions/set_env.h index 194ee239..c9f971de 100644 --- a/src/actions/set_env.h +++ b/src/actions/set_env.h @@ -32,7 +32,7 @@ namespace actions { class SetENV : public Action { public: - explicit SetENV(std::string _action) + explicit SetENV(const std::string &_action) : Action(_action) { } explicit SetENV(std::unique_ptr z) diff --git a/src/actions/set_rsc.h b/src/actions/set_rsc.h index b3354002..e6cfabe0 100644 --- a/src/actions/set_rsc.h +++ b/src/actions/set_rsc.h @@ -32,7 +32,7 @@ namespace actions { class SetRSC : public Action { public: - explicit SetRSC(std::string _action) + explicit SetRSC(const std::string &_action) : Action(_action) { } explicit SetRSC(std::unique_ptr z) diff --git a/src/actions/set_sid.h b/src/actions/set_sid.h index 727745dd..f19fb9eb 100644 --- a/src/actions/set_sid.h +++ b/src/actions/set_sid.h @@ -32,7 +32,7 @@ namespace actions { class SetSID : public Action { public: - explicit SetSID(std::string _action) + explicit SetSID(const std::string &_action) : Action(_action) { } explicit SetSID(std::unique_ptr z) diff --git a/src/actions/set_uid.h b/src/actions/set_uid.h index 38c5aaa7..cd1bdd61 100644 --- a/src/actions/set_uid.h +++ b/src/actions/set_uid.h @@ -32,7 +32,7 @@ namespace actions { class SetUID : public Action { public: - explicit SetUID(std::string _action) + explicit SetUID(const std::string &_action) : Action(_action) { } explicit SetUID(std::unique_ptr z) diff --git a/src/actions/severity.h b/src/actions/severity.h index e67633d6..c0a85994 100644 --- a/src/actions/severity.h +++ b/src/actions/severity.h @@ -31,7 +31,7 @@ namespace actions { class Severity : public Action { public: - explicit Severity(std::string action) + explicit Severity(const std::string &action) : Action(action), m_severity(0) { } diff --git a/src/actions/skip.h b/src/actions/skip.h index 0d7160ee..1c38202b 100644 --- a/src/actions/skip.h +++ b/src/actions/skip.h @@ -29,7 +29,7 @@ namespace actions { class Skip : public Action { public: - explicit Skip(std::string action) + explicit Skip(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind), m_skip_next(0) { } diff --git a/src/actions/skip_after.h b/src/actions/skip_after.h index a0017c09..5f29b9d8 100644 --- a/src/actions/skip_after.h +++ b/src/actions/skip_after.h @@ -29,7 +29,7 @@ namespace actions { class SkipAfter : public Action { public: - explicit SkipAfter(std::string action) + explicit SkipAfter(const std::string &action) : Action(action, RunTimeOnlyIfMatchKind) { } bool evaluate(Rule *rule, Transaction *transaction) override; diff --git a/src/actions/transformations/base64_decode.h b/src/actions/transformations/base64_decode.h index e16c132f..7926f090 100644 --- a/src/actions/transformations/base64_decode.h +++ b/src/actions/transformations/base64_decode.h @@ -30,7 +30,7 @@ namespace transformations { class Base64Decode : public Transformation { public: - explicit Base64Decode(std::string action) : Transformation(action) { } + explicit Base64Decode(const std::string &action) : Transformation(action) { } std::string evaluate(std::string exp, Transaction *transaction) override; diff --git a/src/actions/transformations/base64_decode_ext.h b/src/actions/transformations/base64_decode_ext.h index 903ccdd0..b959bbe4 100644 --- a/src/actions/transformations/base64_decode_ext.h +++ b/src/actions/transformations/base64_decode_ext.h @@ -30,7 +30,7 @@ namespace transformations { class Base64DecodeExt : public Transformation { public: - explicit Base64DecodeExt(std::string action) : Transformation(action) { } + explicit Base64DecodeExt(const std::string &action) : Transformation(action) { } std::string evaluate(std::string exp, Transaction *transaction) override; diff --git a/src/actions/transformations/base64_encode.h b/src/actions/transformations/base64_encode.h index b04d6b65..1ba77bf4 100644 --- a/src/actions/transformations/base64_encode.h +++ b/src/actions/transformations/base64_encode.h @@ -30,7 +30,7 @@ namespace transformations { class Base64Encode : public Transformation { public: - explicit Base64Encode(std::string action) : Transformation(action) { } + explicit Base64Encode(const std::string &action) : Transformation(action) { } std::string evaluate(std::string exp, Transaction *transaction) override; diff --git a/src/actions/transformations/cmd_line.h b/src/actions/transformations/cmd_line.h index 13843ad9..e70d752f 100644 --- a/src/actions/transformations/cmd_line.h +++ b/src/actions/transformations/cmd_line.h @@ -30,7 +30,7 @@ namespace transformations { class CmdLine : public Transformation { public: - explicit CmdLine(std::string action) + explicit CmdLine(const std::string &action) : Transformation(action) { } std::string evaluate(std::string exp, diff --git a/src/actions/transformations/compress_whitespace.cc b/src/actions/transformations/compress_whitespace.cc index b51654aa..83d047ef 100644 --- a/src/actions/transformations/compress_whitespace.cc +++ b/src/actions/transformations/compress_whitespace.cc @@ -30,7 +30,7 @@ namespace modsecurity { namespace actions { namespace transformations { -CompressWhitespace::CompressWhitespace(std::string action) +CompressWhitespace::CompressWhitespace(const std::string &action) : Transformation(action) { this->action_kind = 1; } diff --git a/src/actions/transformations/compress_whitespace.h b/src/actions/transformations/compress_whitespace.h index 3b569595..f4c490ee 100644 --- a/src/actions/transformations/compress_whitespace.h +++ b/src/actions/transformations/compress_whitespace.h @@ -30,7 +30,7 @@ namespace transformations { class CompressWhitespace : public Transformation { public: - explicit CompressWhitespace(std::string action); + explicit CompressWhitespace(const std::string &action) ; std::string evaluate(std::string exp, Transaction *transaction) override; }; diff --git a/src/actions/transformations/css_decode.h b/src/actions/transformations/css_decode.h index 6861ea4b..f97d1979 100644 --- a/src/actions/transformations/css_decode.h +++ b/src/actions/transformations/css_decode.h @@ -31,7 +31,7 @@ namespace transformations { class CssDecode : public Transformation { public: - explicit CssDecode(std::string action) + explicit CssDecode(const std::string &action) : Transformation(action) { } std::string evaluate(std::string exp, Transaction *transaction) override; diff --git a/src/actions/transformations/escape_seq_decode.cc b/src/actions/transformations/escape_seq_decode.cc index 2525e306..e9797ad2 100644 --- a/src/actions/transformations/escape_seq_decode.cc +++ b/src/actions/transformations/escape_seq_decode.cc @@ -31,7 +31,7 @@ namespace modsecurity { namespace actions { namespace transformations { -EscapeSeqDecode::EscapeSeqDecode(std::string action) +EscapeSeqDecode::EscapeSeqDecode(const std::string &action) : Transformation(action) { this->action_kind = 1; } diff --git a/src/actions/transformations/escape_seq_decode.h b/src/actions/transformations/escape_seq_decode.h index 3ada2fbb..b046dace 100644 --- a/src/actions/transformations/escape_seq_decode.h +++ b/src/actions/transformations/escape_seq_decode.h @@ -30,7 +30,7 @@ namespace transformations { class EscapeSeqDecode : public Transformation { public: - explicit EscapeSeqDecode(std::string action); + explicit EscapeSeqDecode(const std::string &action) ; std::string evaluate(std::string exp, Transaction *transaction) override; int ansi_c_sequences_decode_inplace(unsigned char *input, int input_len); diff --git a/src/actions/transformations/hex_decode.h b/src/actions/transformations/hex_decode.h index fe951438..e0eb4fa0 100644 --- a/src/actions/transformations/hex_decode.h +++ b/src/actions/transformations/hex_decode.h @@ -30,7 +30,7 @@ namespace transformations { class HexDecode : public Transformation { public: - explicit HexDecode(std::string action) : Transformation(action) { } + explicit HexDecode(const std::string &action) : Transformation(action) { } std::string evaluate(std::string exp, Transaction *transaction) override; diff --git a/src/actions/transformations/hex_encode.cc b/src/actions/transformations/hex_encode.cc index 4f55d1fe..a88d72fe 100644 --- a/src/actions/transformations/hex_encode.cc +++ b/src/actions/transformations/hex_encode.cc @@ -31,7 +31,7 @@ namespace modsecurity { namespace actions { namespace transformations { -HexEncode::HexEncode(std::string action) +HexEncode::HexEncode(const std::string &action) : Transformation(action) { this->action_kind = 1; } diff --git a/src/actions/transformations/hex_encode.h b/src/actions/transformations/hex_encode.h index 74d12604..3862f72d 100644 --- a/src/actions/transformations/hex_encode.h +++ b/src/actions/transformations/hex_encode.h @@ -30,7 +30,7 @@ namespace transformations { class HexEncode : public Transformation { public: - explicit HexEncode(std::string action); + explicit HexEncode(const std::string &action) ; std::string evaluate(std::string exp, Transaction *transaction) override; }; diff --git a/src/actions/transformations/html_entity_decode.cc b/src/actions/transformations/html_entity_decode.cc index ed119856..26a2915a 100644 --- a/src/actions/transformations/html_entity_decode.cc +++ b/src/actions/transformations/html_entity_decode.cc @@ -60,7 +60,7 @@ int HtmlEntityDecode::inplace(unsigned char *input, uint64_t input_len) { unsigned char *d = input; int i, count; - if ((input == NULL) || (input_len <= 0)) { + if ((input == NULL) || (input_len == 0)) { return 0; } diff --git a/src/actions/transformations/html_entity_decode.h b/src/actions/transformations/html_entity_decode.h index bd1b5250..06c535d4 100644 --- a/src/actions/transformations/html_entity_decode.h +++ b/src/actions/transformations/html_entity_decode.h @@ -33,7 +33,7 @@ namespace transformations { class HtmlEntityDecode : public Transformation { public: - explicit HtmlEntityDecode(std::string action) + explicit HtmlEntityDecode(const std::string &action) : Transformation(action) { } std::string evaluate(std::string exp, diff --git a/src/actions/transformations/js_decode.h b/src/actions/transformations/js_decode.h index 86f6b330..fa26c838 100644 --- a/src/actions/transformations/js_decode.h +++ b/src/actions/transformations/js_decode.h @@ -30,7 +30,7 @@ namespace transformations { class JsDecode : public Transformation { public: - explicit JsDecode(std::string action) + explicit JsDecode(const std::string &action) : Transformation(action) { } std::string evaluate(std::string exp, diff --git a/src/actions/transformations/length.cc b/src/actions/transformations/length.cc index 7c32f80f..8a6287a5 100644 --- a/src/actions/transformations/length.cc +++ b/src/actions/transformations/length.cc @@ -30,7 +30,7 @@ namespace modsecurity { namespace actions { namespace transformations { -Length::Length(std::string action) +Length::Length(const std::string &action) : Transformation(action) { this->action_kind = 1; } diff --git a/src/actions/transformations/length.h b/src/actions/transformations/length.h index 0a2ef6bc..9a375423 100644 --- a/src/actions/transformations/length.h +++ b/src/actions/transformations/length.h @@ -30,7 +30,7 @@ namespace transformations { class Length : public Transformation { public: - explicit Length(std::string action); + explicit Length(const std::string &action) ; std::string evaluate(std::string exp, Transaction *transaction) override; }; diff --git a/src/actions/transformations/lower_case.cc b/src/actions/transformations/lower_case.cc index 8dd0bcae..f02af7d3 100644 --- a/src/actions/transformations/lower_case.cc +++ b/src/actions/transformations/lower_case.cc @@ -27,7 +27,7 @@ namespace actions { namespace transformations { -LowerCase::LowerCase(std::string a) +LowerCase::LowerCase(const std::string &a) : Transformation(a) { } diff --git a/src/actions/transformations/lower_case.h b/src/actions/transformations/lower_case.h index 41e81761..223dad45 100644 --- a/src/actions/transformations/lower_case.h +++ b/src/actions/transformations/lower_case.h @@ -32,7 +32,7 @@ namespace transformations { class LowerCase : public Transformation { public: - explicit LowerCase(std::string action); + explicit LowerCase(const std::string &action) ; std::string evaluate(std::string exp, Transaction *transaction) override; }; diff --git a/src/actions/transformations/md5.h b/src/actions/transformations/md5.h index b53b21fb..cc6e128b 100644 --- a/src/actions/transformations/md5.h +++ b/src/actions/transformations/md5.h @@ -30,7 +30,7 @@ namespace transformations { class Md5 : public Transformation { public: - explicit Md5(std::string action) : Transformation(action) { } + explicit Md5(const std::string &action) : Transformation(action) { } std::string evaluate(std::string exp, Transaction *transaction) override; diff --git a/src/actions/transformations/none.h b/src/actions/transformations/none.h index 5d868d1f..af34d1e8 100644 --- a/src/actions/transformations/none.h +++ b/src/actions/transformations/none.h @@ -30,7 +30,7 @@ namespace transformations { class None : public Transformation { public: - explicit None(std::string action) + explicit None(const std::string &action) : Transformation(action) { m_isNone = true; } diff --git a/src/actions/transformations/normalise_path.cc b/src/actions/transformations/normalise_path.cc index 5d17e0ed..d0be405f 100644 --- a/src/actions/transformations/normalise_path.cc +++ b/src/actions/transformations/normalise_path.cc @@ -32,7 +32,7 @@ namespace modsecurity { namespace actions { namespace transformations { -NormalisePath::NormalisePath(std::string action) +NormalisePath::NormalisePath(const std::string &action) : Transformation(action) { this->action_kind = 1; } diff --git a/src/actions/transformations/normalise_path.h b/src/actions/transformations/normalise_path.h index 1df1ce55..58a28c31 100644 --- a/src/actions/transformations/normalise_path.h +++ b/src/actions/transformations/normalise_path.h @@ -30,7 +30,7 @@ namespace transformations { class NormalisePath : public Transformation { public: - explicit NormalisePath(std::string action); + explicit NormalisePath(const std::string &action) ; std::string evaluate(std::string exp, Transaction *transaction) override; diff --git a/src/actions/transformations/normalise_path_win.h b/src/actions/transformations/normalise_path_win.h index f0449529..f82e4b9f 100644 --- a/src/actions/transformations/normalise_path_win.h +++ b/src/actions/transformations/normalise_path_win.h @@ -30,7 +30,7 @@ namespace transformations { class NormalisePathWin : public Transformation { public: - explicit NormalisePathWin(std::string action) + explicit NormalisePathWin(const std::string &action) : Transformation(action) { } std::string evaluate(std::string exp, diff --git a/src/actions/transformations/parity_even_7bit.h b/src/actions/transformations/parity_even_7bit.h index 672c406b..24e9a452 100644 --- a/src/actions/transformations/parity_even_7bit.h +++ b/src/actions/transformations/parity_even_7bit.h @@ -30,7 +30,7 @@ namespace transformations { class ParityEven7bit : public Transformation { public: - explicit ParityEven7bit(std::string action) : Transformation(action) { } + explicit ParityEven7bit(const std::string &action) : Transformation(action) { } std::string evaluate(std::string exp, Transaction *transaction) override; static bool inplace(unsigned char *input, uint64_t input_len); diff --git a/src/actions/transformations/parity_odd_7bit.h b/src/actions/transformations/parity_odd_7bit.h index 14fa9ff8..dc936bf9 100644 --- a/src/actions/transformations/parity_odd_7bit.h +++ b/src/actions/transformations/parity_odd_7bit.h @@ -30,7 +30,7 @@ namespace transformations { class ParityOdd7bit : public Transformation { public: - explicit ParityOdd7bit(std::string action) : Transformation(action) { } + explicit ParityOdd7bit(const std::string &action) : Transformation(action) { } std::string evaluate(std::string exp, Transaction *transaction) override; static bool inplace(unsigned char *input, uint64_t input_len); diff --git a/src/actions/transformations/parity_zero_7bit.h b/src/actions/transformations/parity_zero_7bit.h index 3904c3a4..7ef409e9 100644 --- a/src/actions/transformations/parity_zero_7bit.h +++ b/src/actions/transformations/parity_zero_7bit.h @@ -30,7 +30,7 @@ namespace transformations { class ParityZero7bit : public Transformation { public: - explicit ParityZero7bit(std::string action) : Transformation(action) { } + explicit ParityZero7bit(const std::string &action) : Transformation(action) { } std::string evaluate(std::string exp, Transaction *transaction) override; static bool inplace(unsigned char *input, uint64_t input_len); diff --git a/src/actions/transformations/remove_comments.h b/src/actions/transformations/remove_comments.h index 481a1d14..e9b23966 100644 --- a/src/actions/transformations/remove_comments.h +++ b/src/actions/transformations/remove_comments.h @@ -31,7 +31,7 @@ namespace transformations { class RemoveComments : public Transformation { public: - explicit RemoveComments(std::string action) : Transformation(action) { } + explicit RemoveComments(const std::string &action) : Transformation(action) { } std::string evaluate(std::string exp, Transaction *transaction) override; diff --git a/src/actions/transformations/remove_comments_char.cc b/src/actions/transformations/remove_comments_char.cc index 150235ba..1455b52f 100644 --- a/src/actions/transformations/remove_comments_char.cc +++ b/src/actions/transformations/remove_comments_char.cc @@ -30,7 +30,7 @@ namespace modsecurity { namespace actions { namespace transformations { -RemoveCommentsChar::RemoveCommentsChar(std::string action) +RemoveCommentsChar::RemoveCommentsChar(const std::string &action) : Transformation(action) { this->action_kind = 1; } diff --git a/src/actions/transformations/remove_comments_char.h b/src/actions/transformations/remove_comments_char.h index adae0a07..33ba8e18 100644 --- a/src/actions/transformations/remove_comments_char.h +++ b/src/actions/transformations/remove_comments_char.h @@ -30,7 +30,7 @@ namespace transformations { class RemoveCommentsChar : public Transformation { public: - explicit RemoveCommentsChar(std::string action); + explicit RemoveCommentsChar(const std::string &action) ; std::string evaluate(std::string exp, Transaction *transaction) override; }; diff --git a/src/actions/transformations/remove_nulls.h b/src/actions/transformations/remove_nulls.h index f09fddfc..ef4c28c0 100644 --- a/src/actions/transformations/remove_nulls.h +++ b/src/actions/transformations/remove_nulls.h @@ -30,7 +30,7 @@ namespace transformations { class RemoveNulls : public Transformation { public: - explicit RemoveNulls(std::string action) + explicit RemoveNulls(const std::string &action) : Transformation(action) { } std::string evaluate(std::string exp, diff --git a/src/actions/transformations/remove_whitespace.cc b/src/actions/transformations/remove_whitespace.cc index 4297a3ee..973d5bad 100644 --- a/src/actions/transformations/remove_whitespace.cc +++ b/src/actions/transformations/remove_whitespace.cc @@ -31,7 +31,7 @@ namespace modsecurity { namespace actions { namespace transformations { -RemoveWhitespace::RemoveWhitespace(std::string action) +RemoveWhitespace::RemoveWhitespace(const std::string &action) : Transformation(action) { this->action_kind = 1; } diff --git a/src/actions/transformations/remove_whitespace.h b/src/actions/transformations/remove_whitespace.h index ecafb34d..82336c05 100644 --- a/src/actions/transformations/remove_whitespace.h +++ b/src/actions/transformations/remove_whitespace.h @@ -30,7 +30,7 @@ namespace transformations { class RemoveWhitespace : public Transformation { public: - explicit RemoveWhitespace(std::string action); + explicit RemoveWhitespace(const std::string &action) ; std::string evaluate(std::string exp, Transaction *transaction) override; }; diff --git a/src/actions/transformations/replace_comments.cc b/src/actions/transformations/replace_comments.cc index b2c61086..b64b1376 100644 --- a/src/actions/transformations/replace_comments.cc +++ b/src/actions/transformations/replace_comments.cc @@ -31,7 +31,7 @@ namespace modsecurity { namespace actions { namespace transformations { -ReplaceComments::ReplaceComments(std::string action) +ReplaceComments::ReplaceComments(const std::string &action) : Transformation(action) { this->action_kind = 1; } diff --git a/src/actions/transformations/replace_comments.h b/src/actions/transformations/replace_comments.h index 1bbe735f..77cbaecc 100644 --- a/src/actions/transformations/replace_comments.h +++ b/src/actions/transformations/replace_comments.h @@ -30,7 +30,7 @@ namespace transformations { class ReplaceComments : public Transformation { public: - explicit ReplaceComments(std::string action); + explicit ReplaceComments(const std::string &action) ; std::string evaluate(std::string exp, Transaction *transaction) override; }; diff --git a/src/actions/transformations/replace_nulls.cc b/src/actions/transformations/replace_nulls.cc index 01996cc3..32328a78 100644 --- a/src/actions/transformations/replace_nulls.cc +++ b/src/actions/transformations/replace_nulls.cc @@ -30,7 +30,7 @@ namespace modsecurity { namespace actions { namespace transformations { -ReplaceNulls::ReplaceNulls(std::string action) +ReplaceNulls::ReplaceNulls(const std::string &action) : Transformation(action) { this->action_kind = 1; } diff --git a/src/actions/transformations/replace_nulls.h b/src/actions/transformations/replace_nulls.h index 353a4943..b96e3d27 100644 --- a/src/actions/transformations/replace_nulls.h +++ b/src/actions/transformations/replace_nulls.h @@ -30,7 +30,7 @@ namespace transformations { class ReplaceNulls : public Transformation { public: - explicit ReplaceNulls(std::string action); + explicit ReplaceNulls(const std::string &action) ; std::string evaluate(std::string exp, Transaction *transaction) override; }; diff --git a/src/actions/transformations/sha1.cc b/src/actions/transformations/sha1.cc index 0e1f8bb2..9f6f1948 100644 --- a/src/actions/transformations/sha1.cc +++ b/src/actions/transformations/sha1.cc @@ -31,7 +31,7 @@ namespace modsecurity { namespace actions { namespace transformations { -Sha1::Sha1(std::string action) +Sha1::Sha1(const std::string &action) : Transformation(action) { this->action_kind = 1; } diff --git a/src/actions/transformations/sha1.h b/src/actions/transformations/sha1.h index 61026dec..37df556c 100644 --- a/src/actions/transformations/sha1.h +++ b/src/actions/transformations/sha1.h @@ -30,7 +30,7 @@ namespace transformations { class Sha1 : public Transformation { public: - explicit Sha1(std::string action); + explicit Sha1(const std::string &action) ; std::string evaluate(std::string exp, Transaction *transaction) override; }; diff --git a/src/actions/transformations/sql_hex_decode.h b/src/actions/transformations/sql_hex_decode.h index 6d05415d..81774ca2 100644 --- a/src/actions/transformations/sql_hex_decode.h +++ b/src/actions/transformations/sql_hex_decode.h @@ -30,7 +30,7 @@ namespace transformations { class SqlHexDecode : public Transformation { public: - explicit SqlHexDecode(std::string action) : Transformation(action) { } + explicit SqlHexDecode(const std::string &action) : Transformation(action) { } std::string evaluate(std::string exp, Transaction *transaction) override; diff --git a/src/actions/transformations/trim.cc b/src/actions/transformations/trim.cc index cd70ac7d..b228b010 100644 --- a/src/actions/transformations/trim.cc +++ b/src/actions/transformations/trim.cc @@ -50,7 +50,7 @@ std::string *Trim::trim(std::string *s) { } -Trim::Trim(std::string action) +Trim::Trim(const std::string &action) : Transformation(action) { this->action_kind = 1; } diff --git a/src/actions/transformations/trim.h b/src/actions/transformations/trim.h index 064e6083..c6862fba 100644 --- a/src/actions/transformations/trim.h +++ b/src/actions/transformations/trim.h @@ -30,7 +30,7 @@ namespace transformations { class Trim : public Transformation { public: - explicit Trim(std::string action); + explicit Trim(const std::string &action) ; std::string evaluate(std::string exp, Transaction *transaction) override; diff --git a/src/actions/transformations/trim_left.cc b/src/actions/transformations/trim_left.cc index b2ea6af5..aa8a18fe 100644 --- a/src/actions/transformations/trim_left.cc +++ b/src/actions/transformations/trim_left.cc @@ -33,7 +33,7 @@ namespace transformations { -TrimLeft::TrimLeft(std::string action) +TrimLeft::TrimLeft(const std::string &action) : Trim(action) { this->action_kind = 1; } diff --git a/src/actions/transformations/trim_left.h b/src/actions/transformations/trim_left.h index f665cd63..048b8b00 100644 --- a/src/actions/transformations/trim_left.h +++ b/src/actions/transformations/trim_left.h @@ -31,7 +31,7 @@ namespace transformations { class TrimLeft : public Trim { public: - explicit TrimLeft(std::string action); + explicit TrimLeft(const std::string &action) ; std::string evaluate(std::string exp, Transaction *transaction) override; }; diff --git a/src/actions/transformations/trim_right.cc b/src/actions/transformations/trim_right.cc index d543bd4b..4852aaed 100644 --- a/src/actions/transformations/trim_right.cc +++ b/src/actions/transformations/trim_right.cc @@ -31,7 +31,7 @@ namespace actions { namespace transformations { -TrimRight::TrimRight(std::string action) +TrimRight::TrimRight(const std::string &action) : Trim(action) { this->action_kind = 1; } diff --git a/src/actions/transformations/trim_right.h b/src/actions/transformations/trim_right.h index d2b5e654..3113ae1a 100644 --- a/src/actions/transformations/trim_right.h +++ b/src/actions/transformations/trim_right.h @@ -31,7 +31,7 @@ namespace transformations { class TrimRight : public Trim { public: - explicit TrimRight(std::string action); + explicit TrimRight(const std::string &action) ; std::string evaluate(std::string exp, Transaction *transaction) override; }; diff --git a/src/actions/transformations/upper_case.cc b/src/actions/transformations/upper_case.cc index ff082e8e..63325d6e 100644 --- a/src/actions/transformations/upper_case.cc +++ b/src/actions/transformations/upper_case.cc @@ -27,7 +27,7 @@ namespace actions { namespace transformations { -UpperCase::UpperCase(std::string a) +UpperCase::UpperCase(const std::string &a) : Transformation(a) { } diff --git a/src/actions/transformations/upper_case.h b/src/actions/transformations/upper_case.h index 6738cd17..f3ac1702 100644 --- a/src/actions/transformations/upper_case.h +++ b/src/actions/transformations/upper_case.h @@ -32,7 +32,7 @@ namespace transformations { class UpperCase : public Transformation { public: - explicit UpperCase(std::string action); + explicit UpperCase(const std::string &action) ; std::string evaluate(std::string exp, Transaction *transaction) override; }; diff --git a/src/actions/transformations/url_decode.cc b/src/actions/transformations/url_decode.cc index 3c2e3e6d..a403f130 100644 --- a/src/actions/transformations/url_decode.cc +++ b/src/actions/transformations/url_decode.cc @@ -32,7 +32,7 @@ namespace actions { namespace transformations { -UrlDecode::UrlDecode(std::string action) +UrlDecode::UrlDecode(const std::string &action) : Transformation(action) { this->action_kind = 1; } diff --git a/src/actions/transformations/url_decode.h b/src/actions/transformations/url_decode.h index 9777153b..9d644ae6 100644 --- a/src/actions/transformations/url_decode.h +++ b/src/actions/transformations/url_decode.h @@ -32,7 +32,7 @@ namespace transformations { class UrlDecode : public Transformation { public: - explicit UrlDecode(std::string action); + explicit UrlDecode(const std::string &action) ; std::string evaluate(std::string exp, Transaction *transaction) override; }; diff --git a/src/actions/transformations/url_decode_uni.h b/src/actions/transformations/url_decode_uni.h index fc08f9a9..e4932be8 100644 --- a/src/actions/transformations/url_decode_uni.h +++ b/src/actions/transformations/url_decode_uni.h @@ -31,7 +31,7 @@ namespace transformations { class UrlDecodeUni : public Transformation { public: - explicit UrlDecodeUni(std::string action) : Transformation(action) { } + explicit UrlDecodeUni(const std::string &action) : Transformation(action) { } std::string evaluate(std::string exp, Transaction *transaction) override; static int inplace(unsigned char *input, uint64_t input_len, diff --git a/src/actions/transformations/url_encode.cc b/src/actions/transformations/url_encode.cc index b3580a9f..004e57ec 100644 --- a/src/actions/transformations/url_encode.cc +++ b/src/actions/transformations/url_encode.cc @@ -31,7 +31,7 @@ namespace actions { namespace transformations { -UrlEncode::UrlEncode(std::string action) +UrlEncode::UrlEncode(const std::string &action) : Transformation(action) { this->action_kind = 1; } diff --git a/src/actions/transformations/url_encode.h b/src/actions/transformations/url_encode.h index 4f1dcc13..e8656517 100644 --- a/src/actions/transformations/url_encode.h +++ b/src/actions/transformations/url_encode.h @@ -30,7 +30,7 @@ namespace transformations { class UrlEncode : public Transformation { public: - explicit UrlEncode(std::string action); + explicit UrlEncode(const std::string &action) ; std::string evaluate(std::string exp, Transaction *transaction) override; diff --git a/src/actions/transformations/utf8_to_unicode.h b/src/actions/transformations/utf8_to_unicode.h index 2a011517..d336bc11 100644 --- a/src/actions/transformations/utf8_to_unicode.h +++ b/src/actions/transformations/utf8_to_unicode.h @@ -35,7 +35,7 @@ namespace transformations { class Utf8ToUnicode : public Transformation { public: - explicit Utf8ToUnicode(std::string action) : Transformation(action) { } + explicit Utf8ToUnicode(const std::string &action) : Transformation(action) { } std::string evaluate(std::string exp, Transaction *transaction) override; diff --git a/src/actions/ver.h b/src/actions/ver.h index 4d8e53f9..0ae7bb83 100644 --- a/src/actions/ver.h +++ b/src/actions/ver.h @@ -29,7 +29,7 @@ namespace actions { class Ver : public Action { public: - explicit Ver(std::string action) : Action(action, ConfigurationKind) { } + explicit Ver(const std::string &action) : Action(action, ConfigurationKind) { } bool evaluate(Rule *rule, Transaction *transaction) override; diff --git a/src/actions/xmlns.h b/src/actions/xmlns.h index 23dc8319..9dcd6d56 100644 --- a/src/actions/xmlns.h +++ b/src/actions/xmlns.h @@ -29,7 +29,7 @@ namespace actions { class XmlNS : public Action { public: - explicit XmlNS(std::string action) : Action(action) { } + explicit XmlNS(const std::string &action) : Action(action) { } bool evaluate(Rule *rule, Transaction *transaction) override { return true;