diff --git a/src/actions/transformations/remove_whitespace.cc b/src/actions/transformations/remove_whitespace.cc index 9b558280..b9ffcc06 100644 --- a/src/actions/transformations/remove_whitespace.cc +++ b/src/actions/transformations/remove_whitespace.cc @@ -25,7 +25,6 @@ #include "modsecurity/transaction.h" #include "src/actions/transformations/transformation.h" -#define NBSP 160 // non breaking space char namespace modsecurity { namespace actions { @@ -41,12 +40,15 @@ std::string RemoveWhitespace::evaluate(const std::string &val, std::string value(val); int64_t i = 0; - char nonBreakingSpaces = 0xa0; + const char nonBreakingSpaces = 0xa0; + const char nonBreakingSpaces2 = 0xc2; // loop through all the chars while (i < value.size()) { // remove whitespaces and non breaking spaces (NBSP) - if (isspace(value[i]) || (value[i] == nonBreakingSpaces)) { + if (std::isspace(static_cast(value[i])) + || (value[i] == nonBreakingSpaces) + || value[i] == nonBreakingSpaces2) { value.erase(i, 1); } else { /* if the space is not a whitespace char, increment counter diff --git a/src/audit_log/writer/https.cc b/src/audit_log/writer/https.cc index 7742a063..1f1b7e2f 100644 --- a/src/audit_log/writer/https.cc +++ b/src/audit_log/writer/https.cc @@ -53,7 +53,7 @@ bool Https::write(Transaction *transaction, int parts, std::string *error) { std::string log = transaction->toJSON(parts); m_http_client.setRequestType("application/json"); - m_http_client.setRequestBody(log.c_str()); + m_http_client.setRequestBody(log); m_http_client.download(m_audit->m_path1); return true; }