mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Simplify code for JSON audit log
This commit is contained in:
@@ -311,7 +311,7 @@ class RulesSetProperties {
|
||||
};
|
||||
|
||||
|
||||
static const char *ruleEngineStateString(RuleEngine i) {
|
||||
static std::string ruleEngineStateString(RuleEngine i) {
|
||||
switch (i) {
|
||||
case DisabledRuleEngine:
|
||||
return "Disabled";
|
||||
@@ -322,7 +322,7 @@ class RulesSetProperties {
|
||||
case PropertyNotSetRuleEngine:
|
||||
return "PropertyNotSet/DetectionOnly";
|
||||
}
|
||||
return NULL;
|
||||
return std::string{};
|
||||
}
|
||||
|
||||
|
||||
|
@@ -80,15 +80,14 @@ typedef struct Rules_t RulesSet;
|
||||
|
||||
#define LOGFY_ADD(a, b) \
|
||||
yajl_gen_string(g, reinterpret_cast<const unsigned char*>(a), strlen(a)); \
|
||||
if (b == NULL) { \
|
||||
if (b.data() == NULL) { \
|
||||
yajl_gen_string(g, reinterpret_cast<const unsigned char*>(""), \
|
||||
strlen("")); \
|
||||
} else { \
|
||||
yajl_gen_string(g, reinterpret_cast<const unsigned char*>(b), \
|
||||
strlen(b)); \
|
||||
yajl_gen_string(g, reinterpret_cast<const unsigned char*>(b.data()), \
|
||||
b.length()); \
|
||||
}
|
||||
|
||||
|
||||
#define LOGFY_ADD_INT(a, b) \
|
||||
yajl_gen_string(g, reinterpret_cast<const unsigned char*>(a), strlen(a)); \
|
||||
yajl_gen_number(g, reinterpret_cast<const char*>(b), strlen(b));
|
||||
|
Reference in New Issue
Block a user