mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-15 23:55:03 +03:00
Adds support to replaceNulls transformation
This commit is contained in:
parent
9932478705
commit
1716add77b
@ -37,14 +37,18 @@ ReplaceNulls::ReplaceNulls(std::string action)
|
|||||||
|
|
||||||
std::string ReplaceNulls::evaluate(std::string value,
|
std::string ReplaceNulls::evaluate(std::string value,
|
||||||
Assay *assay) {
|
Assay *assay) {
|
||||||
/**
|
int64_t i;
|
||||||
* @todo Implement the transformation ReplaceNulls
|
|
||||||
*/
|
i = 0;
|
||||||
if (assay) {
|
while (i < value.size()) {
|
||||||
#ifndef NO_LOGS
|
if (value.at(i) == '\0') {
|
||||||
assay->debug(4, "Transformation ReplaceNulls is not implemented yet.");
|
value.erase(i, 1);
|
||||||
#endif
|
value.insert(i, " ", 1);
|
||||||
|
} else {
|
||||||
|
i++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ Transformation* Transformation::instantiate(std::string a) {
|
|||||||
IF_MATCH(remove_whitespace) { return new RemoveWhitespace(a); }
|
IF_MATCH(remove_whitespace) { return new RemoveWhitespace(a); }
|
||||||
IF_MATCH(compressWhitespace) { return new CompressWhitespace(a); }
|
IF_MATCH(compressWhitespace) { return new CompressWhitespace(a); }
|
||||||
IF_MATCH(replaceComments) { return new ReplaceComments(a); }
|
IF_MATCH(replaceComments) { return new ReplaceComments(a); }
|
||||||
IF_MATCH(replace_nulls) { return new ReplaceNulls(a); }
|
IF_MATCH(replaceNulls) { return new ReplaceNulls(a); }
|
||||||
IF_MATCH(sha1) { return new Sha1(a); }
|
IF_MATCH(sha1) { return new Sha1(a); }
|
||||||
IF_MATCH(sql_hex_decode) { return new SqlHexDecode(a); }
|
IF_MATCH(sql_hex_decode) { return new SqlHexDecode(a); }
|
||||||
IF_MATCH(transformation) { return new Transformation(a); }
|
IF_MATCH(transformation) { return new Transformation(a); }
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 635d86d6f87d56de656da73e3026a6ef2cc9a5f1
|
Subproject commit e363aa647abebe1be523f9bdd5ba4466ba20256e
|
Loading…
x
Reference in New Issue
Block a user