mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-13 21:36:00 +03:00
Cosmetics: address cppcheck warnings on src/actions
This commit is contained in:
parent
a6620604d4
commit
9101a8ab15
@ -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) { }
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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<RuleMessage> rm) override;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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("") { }
|
||||
|
@ -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) { }
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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) { }
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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("") { }
|
||||
|
||||
|
@ -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("") { }
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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) { }
|
||||
|
||||
|
@ -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<RuleMessage> rm) override;
|
||||
|
@ -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<RuleMessage> rm) override;
|
||||
|
@ -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<RuleMessage> rm) override;
|
||||
|
@ -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<RunTimeString> z)
|
||||
: Action("redirert", RunTimeOnlyIfMatchKind),
|
||||
m_status(0),
|
||||
m_string(std::move(z)) { }
|
||||
|
||||
bool evaluate(Rule *rule, Transaction *transaction,
|
||||
|
@ -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("") { }
|
||||
|
||||
|
@ -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<RunTimeString> z)
|
||||
InitCol(const std::string &action, std::unique_ptr<RunTimeString> z)
|
||||
: Action(action, RunTimeOnlyIfMatchKind),
|
||||
m_string(std::move(z)) { }
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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<RunTimeString> z)
|
||||
|
@ -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) { }
|
||||
|
||||
|
@ -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<RunTimeString> z)
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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) { }
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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) { }
|
||||
|
||||
|
@ -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<RunTimeString> z)
|
||||
|
@ -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<RunTimeString> z)
|
||||
|
@ -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<RunTimeString> z)
|
||||
|
@ -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<RunTimeString> z)
|
||||
|
@ -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) { }
|
||||
|
||||
|
@ -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) { }
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -27,7 +27,7 @@ namespace actions {
|
||||
namespace transformations {
|
||||
|
||||
|
||||
LowerCase::LowerCase(std::string a)
|
||||
LowerCase::LowerCase(const std::string &a)
|
||||
: Transformation(a) {
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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;
|
||||
|
@ -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; }
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -33,7 +33,7 @@ namespace transformations {
|
||||
|
||||
|
||||
|
||||
TrimLeft::TrimLeft(std::string action)
|
||||
TrimLeft::TrimLeft(const std::string &action)
|
||||
: Trim(action) {
|
||||
this->action_kind = 1;
|
||||
}
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -27,7 +27,7 @@ namespace actions {
|
||||
namespace transformations {
|
||||
|
||||
|
||||
UpperCase::UpperCase(std::string a)
|
||||
UpperCase::UpperCase(const std::string &a)
|
||||
: Transformation(a) {
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user