mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 11:44:32 +03:00
Moves string related functions from utils' to
utils/string'
This commit is contained in:
@@ -21,13 +21,16 @@
|
||||
#include "modsecurity/transaction.h"
|
||||
#include "modsecurity/rule.h"
|
||||
#include "src/utils.h"
|
||||
#include "utils/msc_string.h"
|
||||
#include "modsecurity/modsecurity.h"
|
||||
|
||||
using modsecurity::utils::String;
|
||||
|
||||
namespace modsecurity {
|
||||
namespace actions {
|
||||
|
||||
bool Allow::init(std::string *error) {
|
||||
std::string a = tolower(m_parser_payload);
|
||||
std::string a = String::tolower(m_parser_payload);
|
||||
|
||||
if (a == "phase") {
|
||||
m_allowType = PhaseAllowType;
|
||||
|
@@ -20,6 +20,10 @@
|
||||
#include <vector>
|
||||
|
||||
#include "modsecurity/transaction.h"
|
||||
#include "utils/msc_string.h"
|
||||
|
||||
using modsecurity::utils::String;
|
||||
|
||||
|
||||
namespace modsecurity {
|
||||
namespace actions {
|
||||
@@ -28,7 +32,7 @@ namespace ctl {
|
||||
|
||||
bool RuleRemoveTargetById::init(std::string *error) {
|
||||
std::string what(m_parser_payload, 21, m_parser_payload.size() - 21);
|
||||
std::vector<std::string> param = split(what, ';');
|
||||
std::vector<std::string> param = String::split(what, ';');
|
||||
|
||||
if (param.size() < 2) {
|
||||
error->assign(what + " is not a valid `ID;VARIABLE'");
|
||||
|
@@ -20,6 +20,9 @@
|
||||
#include <vector>
|
||||
|
||||
#include "modsecurity/transaction.h"
|
||||
#include "utils/msc_string.h"
|
||||
|
||||
using modsecurity::utils::String;
|
||||
|
||||
namespace modsecurity {
|
||||
namespace actions {
|
||||
@@ -28,7 +31,7 @@ namespace ctl {
|
||||
|
||||
bool RuleRemoveTargetByTag::init(std::string *error) {
|
||||
std::string what(m_parser_payload, 22, m_parser_payload.size() - 22);
|
||||
std::vector<std::string> param = split(what, ';');
|
||||
std::vector<std::string> param = String::split(what, ';');
|
||||
|
||||
if (param.size() < 2) {
|
||||
error->assign(what + " is not a valid `TAG;VARIABLE'");
|
||||
|
@@ -22,12 +22,16 @@
|
||||
#include "modsecurity/rule.h"
|
||||
#include "src/utils.h"
|
||||
#include "modsecurity/modsecurity.h"
|
||||
#include "utils/msc_string.h"
|
||||
|
||||
using modsecurity::utils::String;
|
||||
|
||||
|
||||
namespace modsecurity {
|
||||
namespace actions {
|
||||
|
||||
bool Phase::init(std::string *error) {
|
||||
std::string a = tolower(m_parser_payload);
|
||||
std::string a = String::tolower(m_parser_payload);
|
||||
m_phase = -1;
|
||||
|
||||
try {
|
||||
|
@@ -22,6 +22,10 @@
|
||||
#include "modsecurity/rule.h"
|
||||
#include "src/macro_expansion.h"
|
||||
#include "src/utils.h"
|
||||
#include "utils/msc_string.h"
|
||||
|
||||
using modsecurity::utils::String;
|
||||
|
||||
|
||||
namespace modsecurity {
|
||||
namespace actions {
|
||||
@@ -49,7 +53,7 @@ bool SetVar::init(std::string *error) {
|
||||
pos = m_parser_payload.find(".");
|
||||
if (pos != std::string::npos) {
|
||||
m_collectionName = std::string(m_parser_payload, 0, pos);
|
||||
m_collectionName = toupper(m_collectionName);
|
||||
m_collectionName = String::toupper(m_collectionName);
|
||||
} else {
|
||||
error->assign("Missing the collection and/or variable name");
|
||||
return false;
|
||||
|
@@ -22,13 +22,17 @@
|
||||
#include "modsecurity/transaction.h"
|
||||
#include "modsecurity/rule.h"
|
||||
#include "src/utils.h"
|
||||
#include "utils/msc_string.h"
|
||||
|
||||
using modsecurity::utils::String;
|
||||
|
||||
|
||||
namespace modsecurity {
|
||||
namespace actions {
|
||||
|
||||
|
||||
bool Severity::init(std::string *error) {
|
||||
std::string a = tolower(m_parser_payload);
|
||||
std::string a = String::tolower(m_parser_payload);
|
||||
if (a == "emergency") {
|
||||
m_severity = 0;
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user