mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 11:44:32 +03:00
Moves static methods from class String to the namespace string
This commit is contained in:
@@ -47,9 +47,6 @@
|
||||
#include "src/utils/string.h"
|
||||
|
||||
|
||||
using modsecurity::utils::String;
|
||||
|
||||
|
||||
namespace modsecurity {
|
||||
namespace Variables {
|
||||
|
||||
@@ -57,7 +54,7 @@ void Rule::evaluateInternal(Transaction *t,
|
||||
modsecurity::Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::map<std::string, std::string> envs;
|
||||
std::string m_name_upper = String::toupper(m_name);
|
||||
std::string m_name_upper = utils::string::toupper(m_name);
|
||||
|
||||
// id
|
||||
envs.insert(std::pair<std::string, std::string>("RULE:id",
|
||||
@@ -99,7 +96,7 @@ void Rule::evaluateInternal(Transaction *t,
|
||||
}
|
||||
|
||||
for (auto& x : envs) {
|
||||
std::string xup = String::toupper(x.first);
|
||||
std::string xup = utils::string::toupper(x.first);
|
||||
if ((xup.substr(0, m_name_upper.size() + 1)
|
||||
.compare(m_name_upper + ":") != 0)
|
||||
&& (xup != m_name_upper)) {
|
||||
|
@@ -25,7 +25,6 @@
|
||||
#include "src/utils/string.h"
|
||||
|
||||
|
||||
using modsecurity::utils::String;
|
||||
using modsecurity::Variables::Variations::Exclusion;
|
||||
|
||||
|
||||
@@ -39,7 +38,7 @@ Variable::Variable(std::string name)
|
||||
m_isExclusion(false),
|
||||
m_isCount(false) {
|
||||
if (m_name.find(":") != std::string::npos) {
|
||||
std::string col = String::toupper(
|
||||
std::string col = utils::string::toupper(
|
||||
std::string(m_name, 0, m_name.find(":")));
|
||||
std::string name = std::string(m_name, m_name.find(":") + 1,
|
||||
m_name.size());
|
||||
@@ -56,19 +55,19 @@ Variable::Variable(std::string name)
|
||||
m_type = MultipleMatches;
|
||||
}
|
||||
|
||||
if (String::tolower(m_name) == "tx") {
|
||||
if (utils::string::tolower(m_name) == "tx") {
|
||||
m_collectionName = "TX";
|
||||
m_type = MultipleMatches;
|
||||
} else if (String::tolower(m_name) == "ip") {
|
||||
} else if (utils::string::tolower(m_name) == "ip") {
|
||||
m_collectionName = "IP";
|
||||
m_type = MultipleMatches;
|
||||
} else if (String::tolower(m_name) == "global") {
|
||||
} else if (utils::string::tolower(m_name) == "global") {
|
||||
m_collectionName = "GLOBAL";
|
||||
m_type = MultipleMatches;
|
||||
} else if (String::tolower(m_name) == "resource") {
|
||||
} else if (utils::string::tolower(m_name) == "resource") {
|
||||
m_collectionName = "RESOURCE";
|
||||
m_type = MultipleMatches;
|
||||
} else if (String::tolower(m_name) == "session") {
|
||||
} else if (utils::string::tolower(m_name) == "session") {
|
||||
m_collectionName = "SESSION";
|
||||
m_type = MultipleMatches;
|
||||
} else if (m_name.find(".") != std::string::npos) {
|
||||
@@ -87,7 +86,7 @@ Variable::Variable(std::string name, VariableKind kind)
|
||||
m_isExclusion(false),
|
||||
m_isCount(false) {
|
||||
if (m_name.find(":") != std::string::npos) {
|
||||
std::string col = String::toupper(
|
||||
std::string col = utils::string::toupper(
|
||||
std::string(m_name, 0, m_name.find(":")));
|
||||
std::string name = std::string(m_name, m_name.find(":") + 1,
|
||||
m_name.size());
|
||||
@@ -104,19 +103,19 @@ Variable::Variable(std::string name, VariableKind kind)
|
||||
m_type = MultipleMatches;
|
||||
}
|
||||
|
||||
if (String::tolower(m_name) == "tx") {
|
||||
if (utils::string::tolower(m_name) == "tx") {
|
||||
m_collectionName = "TX";
|
||||
m_type = MultipleMatches;
|
||||
} else if (String::tolower(m_name) == "ip") {
|
||||
} else if (utils::string::tolower(m_name) == "ip") {
|
||||
m_collectionName = "IP";
|
||||
m_type = MultipleMatches;
|
||||
} else if (String::tolower(m_name) == "global") {
|
||||
} else if (utils::string::tolower(m_name) == "global") {
|
||||
m_collectionName = "GLOBAL";
|
||||
m_type = MultipleMatches;
|
||||
} else if (String::tolower(m_name) == "resource") {
|
||||
} else if (utils::string::tolower(m_name) == "resource") {
|
||||
m_collectionName = "RESOURCE";
|
||||
m_type = MultipleMatches;
|
||||
} else if (String::tolower(m_name) == "session") {
|
||||
} else if (utils::string::tolower(m_name) == "session") {
|
||||
m_collectionName = "SESSION";
|
||||
m_type = MultipleMatches;
|
||||
} else if (m_name.find(".") != std::string::npos) {
|
||||
|
Reference in New Issue
Block a user