mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-17 09:55:28 +03:00
Updated Transformation::evaluate signature to allow for in-place updates, removing unnecessary heap allocated copies.
- Renamed Transformation::evaluate to Transformation::transform to avoid
confusion with Action's overload methods.
- Updated Transformation::transform signature to receive the value by
reference and perform the transformation inline, if possible.
- Some transformations still need to use a temporary std::string to
perform their work, and then copy the result back.
- Made Transformation::transform methods const and updated Transaction
parameter to be const.
- Transaction parameter could not be removed because it's used by just
a single transformation, UrlDecodeUni.
- Removed std::string Action::evaluate(const std::string &exp,
Transaction *transaction); which was only implemented by
Transformation but was not used from the base class, but only after
downcasting to Transformation, so it can just be declared there (and
not pollute other actions with a default member implementation -that
does nothing- which is never called).
This commit is contained in:
@@ -19,6 +19,14 @@
|
||||
|
||||
#include "src/operators/operator.h"
|
||||
|
||||
|
||||
constexpr int UNICODE_ERROR_CHARACTERS_MISSING = -1;
|
||||
constexpr int UNICODE_ERROR_INVALID_ENCODING = -2;
|
||||
constexpr int UNICODE_ERROR_OVERLONG_CHARACTER = -3;
|
||||
constexpr int UNICODE_ERROR_RESTRICTED_CHARACTER = -4;
|
||||
constexpr int UNICODE_ERROR_DECODING_ERROR = -5;
|
||||
|
||||
|
||||
namespace modsecurity {
|
||||
namespace operators {
|
||||
|
||||
|
||||
@@ -22,13 +22,6 @@
|
||||
#include "src/operators/operator.h"
|
||||
|
||||
|
||||
#define UNICODE_ERROR_CHARACTERS_MISSING -1
|
||||
#define UNICODE_ERROR_INVALID_ENCODING -2
|
||||
#define UNICODE_ERROR_OVERLONG_CHARACTER -3
|
||||
#define UNICODE_ERROR_RESTRICTED_CHARACTER -4
|
||||
#define UNICODE_ERROR_DECODING_ERROR -5
|
||||
|
||||
|
||||
namespace modsecurity {
|
||||
namespace operators {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user