mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 11:44:32 +03:00
Code cosmetic: Having the code following our coding style
This commit also update some methods parameters to const.
This commit is contained in:
@@ -44,7 +44,7 @@ void Redirect::fill_intervention(ModSecurityIntervention *i) {
|
||||
i->status = this->status;
|
||||
}
|
||||
// reinterpret_cast<char *>
|
||||
i->url = (char *) this->url.c_str(); //** TODO: wheee */
|
||||
i->url = this->url.c_str(); //** TODO: wheee */
|
||||
i->log = "Redirecting";
|
||||
}
|
||||
|
||||
|
@@ -40,7 +40,8 @@ std::string& CompressWhitespace::evaluate(std::string value,
|
||||
/**
|
||||
* @todo Implement the transformation CompressWhitespace
|
||||
*/
|
||||
assay->debug(4, "Transformation CompressWhitespace is not implemented yet.");
|
||||
assay->debug(4, "Transformation CompressWhitespace is " \
|
||||
"not implemented yet.");
|
||||
}
|
||||
|
||||
} // namespace transformations
|
||||
|
@@ -41,4 +41,4 @@ class HexDecode : public Transformation {
|
||||
|
||||
#endif
|
||||
|
||||
#endif // SRC_ACTIONS_TRANSFORMATIONS_BASE64DECODE_H_
|
||||
#endif // SRC_ACTIONS_TRANSFORMATIONS_HEX_DECODE_H_
|
||||
|
@@ -18,8 +18,8 @@
|
||||
#include "actions/action.h"
|
||||
#include "actions/transformations/transformation.h"
|
||||
|
||||
#ifndef SRC_ACTIONS_TRANSFORMATIONS_BASE64DECODE_H_
|
||||
#define SRC_ACTIONS_TRANSFORMATIONS_BASE64DECODE_H_
|
||||
#ifndef SRC_ACTIONS_TRANSFORMATIONS_HEX_ENCODE_H_
|
||||
#define SRC_ACTIONS_TRANSFORMATIONS_HEX_ENCODE_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace ModSecurity {
|
||||
@@ -41,4 +41,4 @@ class HexEncode : public Transformation {
|
||||
|
||||
#endif
|
||||
|
||||
#endif // SRC_ACTIONS_TRANSFORMATIONS_BASE64DECODE_H_
|
||||
#endif // SRC_ACTIONS_TRANSFORMATIONS_HEX_ENCODE_H_
|
||||
|
@@ -41,4 +41,4 @@ class ParityOdd7bit : public Transformation {
|
||||
|
||||
#endif
|
||||
|
||||
#endif // SRC_ACTIONS_TRANSFORMATIONS_PARITY_EVEN_7BIT_H_
|
||||
#endif // SRC_ACTIONS_TRANSFORMATIONS_PARITY_ODD_7BIT_H_
|
||||
|
@@ -40,7 +40,8 @@ std::string& RemoveComments::evaluate(std::string value,
|
||||
/**
|
||||
* @todo Implement the transformation RemoveComments
|
||||
*/
|
||||
assay->debug(4, "Transformation RemoveComments is not implemented yet.");
|
||||
assay->debug(4, "Transformation RemoveComments is not " \
|
||||
"implemented yet.");
|
||||
return value;
|
||||
}
|
||||
|
||||
|
@@ -40,7 +40,8 @@ std::string& RemoveCommentsChar::evaluate(std::string value,
|
||||
/**
|
||||
* @todo Implement the transformation RemoveCommentsChar
|
||||
*/
|
||||
assay->debug(4, "Transformation RemoveCommentsChar is not implemented yet.");
|
||||
assay->debug(4, "Transformation RemoveCommentsChar " \
|
||||
"is not implemented yet.");
|
||||
return value;
|
||||
}
|
||||
|
||||
|
@@ -49,7 +49,6 @@
|
||||
#include "actions/transformations/replace_nulls.h"
|
||||
#include "actions/transformations/sha1.h"
|
||||
#include "actions/transformations/sql_hex_decode.h"
|
||||
#include "actions/transformations/transformation.h"
|
||||
#include "actions/transformations/trim.h"
|
||||
#include "actions/transformations/trim_left.h"
|
||||
#include "actions/transformations/trim_right.h"
|
||||
@@ -79,7 +78,6 @@ std::string &Transformation::evaluate(std::string value,
|
||||
}
|
||||
|
||||
Transformation* Transformation::instantiate(std::string a) {
|
||||
|
||||
IF_MATCH(base64_decode_ext) { return new Base64DecodeExt(a); }
|
||||
IF_MATCH(base64_decode) { return new Base64Decode(a); }
|
||||
IF_MATCH(cmd_line) { return new CmdLine(a); }
|
||||
@@ -115,7 +113,7 @@ Transformation* Transformation::instantiate(std::string a) {
|
||||
IF_MATCH(url_decode_uni) { return new UrlDecodeUni(a); }
|
||||
IF_MATCH(url_encode) { return new UrlEncode(a); }
|
||||
IF_MATCH(utf8_to_unicode) { return new Utf8Unicode(a); }
|
||||
|
||||
|
||||
return new Transformation(a);
|
||||
}
|
||||
|
||||
|
@@ -30,7 +30,7 @@ namespace ModSecurity {
|
||||
namespace actions {
|
||||
namespace transformations {
|
||||
|
||||
|
||||
|
||||
TrimRight::TrimRight(std::string action)
|
||||
: Trim(action) {
|
||||
this->action_kind = 1;
|
||||
|
@@ -42,4 +42,4 @@ class TrimRight : public Trim {
|
||||
|
||||
#endif
|
||||
|
||||
#endif // SRC_ACTIONS_TRANSFORMATIONS_TRIM_H_
|
||||
#endif // SRC_ACTIONS_TRANSFORMATIONS_TRIM_RIGHT_H_
|
||||
|
@@ -18,8 +18,8 @@
|
||||
#include "actions/action.h"
|
||||
#include "actions/transformations/transformation.h"
|
||||
|
||||
#ifndef SRC_ACTIONS_TRANSFORMATIONS_UTF8_UNICODE_H_
|
||||
#define SRC_ACTIONS_TRANSFORMATIONS_UTF8_UNICODE_H_
|
||||
#ifndef SRC_ACTIONS_TRANSFORMATIONS_UTF8_TO_UNICODE_H_
|
||||
#define SRC_ACTIONS_TRANSFORMATIONS_UTF8_TO_UNICODE_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace ModSecurity {
|
||||
@@ -41,4 +41,4 @@ class Utf8Unicode : public Transformation {
|
||||
|
||||
#endif
|
||||
|
||||
#endif // SRC_ACTIONS_TRANSFORMATIONS_UTF8_UNICODE_H_
|
||||
#endif // SRC_ACTIONS_TRANSFORMATIONS_UTF8_TO_UNICODE_H_
|
||||
|
Reference in New Issue
Block a user