mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 11:44:32 +03:00
Cosmetics: Fix coding style
This commit is contained in:
@@ -124,8 +124,6 @@ class Action {
|
||||
*/
|
||||
RunTimeOnlyIfMatchKind,
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@@ -36,7 +36,8 @@ bool Allow::init(std::string *error) {
|
||||
} else if (a == "") {
|
||||
m_allowType = FromNowOneAllowType;
|
||||
} else {
|
||||
error->assign("Allow: if specified, the parameter most be: phase, request");
|
||||
error->assign("Allow: if specified, the parameter " \
|
||||
"most be: phase, request");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -29,7 +29,7 @@ class Rule;
|
||||
|
||||
namespace actions {
|
||||
|
||||
enum AllowType : short {
|
||||
enum AllowType : int {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -61,7 +61,7 @@ class Allow : public Action {
|
||||
|
||||
AllowType m_allowType;
|
||||
|
||||
static std::string allowTypeToName (AllowType a) {
|
||||
static std::string allowTypeToName(AllowType a) {
|
||||
if (a == NoneAllowType) {
|
||||
return "None";
|
||||
} else if (a == RequestAllowType) {
|
||||
|
@@ -36,7 +36,8 @@ bool InitCol::init(std::string *error) {
|
||||
return false;
|
||||
}
|
||||
if (posEquals == std::string::npos) {
|
||||
error->assign("Something wrong with initcol format: missing equals sign");
|
||||
error->assign("Something wrong with initcol format: missing " \
|
||||
"equals sign");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -46,7 +47,8 @@ bool InitCol::init(std::string *error) {
|
||||
if (m_collection_key != "ip" &&
|
||||
m_collection_key != "global" &&
|
||||
m_collection_key != "resource") {
|
||||
error->assign("Something wrong with initcol: collection must be `ip' or `global'");
|
||||
error->assign("Something wrong with initcol: collection must be " \
|
||||
"`ip' or `global'");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -30,7 +30,7 @@ namespace transformations {
|
||||
|
||||
class Base64Decode : public Transformation {
|
||||
public:
|
||||
explicit Base64Decode(std::string action) : Transformation(action) { };
|
||||
explicit Base64Decode(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(std::string action) : Transformation(action) { }
|
||||
|
||||
std::string evaluate(std::string exp,
|
||||
Transaction *transaction) override;
|
||||
|
@@ -43,7 +43,6 @@ std::string CmdLine::evaluate(std::string value,
|
||||
case '\'':
|
||||
case '\\':
|
||||
case '^':
|
||||
//ret.append("i was here");
|
||||
break;
|
||||
|
||||
/* replace some characters to space (only one) */
|
||||
@@ -85,3 +84,4 @@ std::string CmdLine::evaluate(std::string value,
|
||||
} // namespace transformations
|
||||
} // namespace actions
|
||||
} // namespace modsecurity
|
||||
|
||||
|
@@ -44,3 +44,4 @@ class CmdLine : public Transformation {
|
||||
#endif
|
||||
|
||||
#endif // SRC_ACTIONS_TRANSFORMATIONS_CMD_LINE_H_
|
||||
|
||||
|
@@ -54,12 +54,13 @@ std::string RemoveCommentsChar::evaluate(std::string value,
|
||||
&& value.at(i+2) == '-'
|
||||
&& (i+3 < value.size())
|
||||
&& value.at(i+3) == '-') {
|
||||
|
||||
value.erase(i, 4);
|
||||
} else if (value.at(i) == '-' && (i+1 < value.size()) && value.at(i+1) == '-' &&
|
||||
(i+2 < value.size()) && value.at(i+2) == '>') {
|
||||
} else if (value.at(i) == '-'
|
||||
&& (i+1 < value.size()) && value.at(i+1) == '-'
|
||||
&& (i+2 < value.size()) && value.at(i+2) == '>') {
|
||||
value.erase(i, 3);
|
||||
} else if (value.at(i) == '-' && (i+1 < value.size()) && value.at(i+1) == '-') {
|
||||
} else if (value.at(i) == '-'
|
||||
&& (i+1 < value.size()) && value.at(i+1) == '-') {
|
||||
value.erase(i, 2);
|
||||
} else if (value.at(i) == '#') {
|
||||
value.erase(i, 1);
|
||||
@@ -73,3 +74,4 @@ std::string RemoveCommentsChar::evaluate(std::string value,
|
||||
} // namespace transformations
|
||||
} // namespace actions
|
||||
} // namespace modsecurity
|
||||
|
||||
|
Reference in New Issue
Block a user