We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 820379b commit 09a6f51Copy full SHA for 09a6f51
src/anchored_set_variable.cc
@@ -127,7 +127,7 @@ std::unique_ptr<std::string> AnchoredSetVariable::resolveFirst(
127
void AnchoredSetVariable::resolveRegularExpression(regex::Regex *r,
128
std::vector<const VariableValue *> *l) {
129
for (const auto& x : *this) {
130
- int ret = regex::regex_search(x.first, *r);
+ int ret = r->search(x.first);
131
if (ret <= 0) {
132
continue;
133
}
@@ -140,7 +140,7 @@ void AnchoredSetVariable::resolveRegularExpression(regex::Regex *r,
140
std::vector<const VariableValue *> *l,
141
Variables::KeyExclusions &ke) {
142
143
144
145
146
src/audit_log/audit_log.cc
@@ -279,8 +279,7 @@ bool AuditLog::isRelevant(int status) {
279
return true;
280
281
282
- return regex::regex_search(sstatus,
283
- regex::Regex(m_relevant)) != 0;
+ return regex::Regex(m_relevant).search(sstatus) != 0;
284
285
286
src/collection/backend/in_memory-per_process.cc
@@ -148,7 +148,7 @@ void InMemoryPerProcess::resolveRegularExpression(const std::string& var,
148
//}
149
//std::string content = std::string(x.first, keySize + 1,
150
// x.first.size() - keySize - 1);
151
- int ret = regex::regex_search(x.first, r);
+ int ret = r.search(x.first);
152
153
154
src/collection/backend/lmdb.cc
@@ -560,7 +560,7 @@ void LMDB::resolveRegularExpression(const std::string& var,
560
561
while ((rc = mdb_cursor_get(cursor, &key, &data, MDB_NEXT)) == 0) {
562
char *a = reinterpret_cast<char *>(key.mv_data);
563
- int ret = regex::regex_search(a, r);
+ int ret = r.search(a);
564
565
566
src/operators/rx.h
@@ -27,7 +27,6 @@
27
28
namespace modsecurity {
29
using regex::RegexMatch;
30
-using regex::regex_search;
31
using regex::Regex;
32
33
namespace operators {
src/operators/verify_cpf.h
@@ -26,7 +26,6 @@
26
src/operators/verify_ssn.h
src/regex/regex.h
@@ -69,16 +69,6 @@ class Regex {
69
};
70
71
72
-static inline int regex_search(const std::string& s, RegexMatch *match, const Regex& regex) {
73
- return regex.search(s, match);
74
-}
75
-
76
77
-static inline int regex_search(const std::string& s, const Regex& regex) {
78
- return regex.search(s);
79
80
81
82
} // namespace regex
83
} // namespace modsecurity
84
src/variables/rule.h
@@ -198,23 +198,23 @@ class Rule_DictElementRegexp : public VariableRegex {
198
void evaluate(Transaction *t,
199
Rule *rule,
200
std::vector<const VariableValue *> *l) override {
201
- if (regex::regex_search("id", m_r) > 0) {
+ if (m_r.search("id") > 0) {
202
Rule_DictElement::id(t, rule, l);
203
return;
204
205
- if (regex::regex_search("rev", m_r) > 0) {
+ if (m_r.search("rev") > 0) {
206
Rule_DictElement::rev(t, rule, l);
207
208
209
- if (regex::regex_search("severity", m_r) > 0) {
+ if (m_r.search("severity") > 0) {
210
Rule_DictElement::severity(t, rule, l);
211
212
213
- if (regex::regex_search("logdata", m_r) > 0) {
+ if (m_r.search("logdata") > 0) {
214
Rule_DictElement::logData(t, rule, l);
215
216
217
- if (regex::regex_search("msg", m_r) > 0) {
+ if (m_r.search("msg") > 0) {
218
Rule_DictElement::msg(t, rule, l);
219
220
test/regression/custom_debug_log.cc
@@ -39,7 +39,7 @@ void CustomDebugLog::write(int level, const std::string &id,
39
bool CustomDebugLog::contains(const std::string& pattern) {
40
modsecurity::regex::Regex re(pattern);
41
std::string s = m_log.str();
42
- return modsecurity::regex::regex_search(s, re);
+ return re.search(s);
43
44
45
std::string CustomDebugLog::log_messages() {
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments