mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-19 10:44:25 +03:00
Extends the direct access model to other collections
This commit is contained in:
committed by
Felipe Zimmerle
parent
ca24b6bb06
commit
f2d149fc5f
@@ -30,18 +30,42 @@ namespace modsecurity {
|
||||
class Transaction;
|
||||
namespace Variables {
|
||||
|
||||
|
||||
/* Invocation without an XPath expression makes sense
|
||||
* with functions that manipulate the document tree.
|
||||
*/
|
||||
class XML_NoDictElement : public Variable {
|
||||
public:
|
||||
explicit XML_NoDictElement()
|
||||
: Variable("XML"),
|
||||
m_plain("[XML document tree]"),
|
||||
m_var(&m_name, &m_plain) {
|
||||
m_var.m_dynamic = false;
|
||||
m_var.m_dynamic_value = false;
|
||||
}
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
l->push_back(&m_var);
|
||||
}
|
||||
|
||||
std::string m_plain;
|
||||
collection::Variable m_var;
|
||||
};
|
||||
|
||||
|
||||
class XML : public Variable {
|
||||
public:
|
||||
explicit XML(std::string _name)
|
||||
: Variable(_name),
|
||||
m_plain("[XML document tree]") { }
|
||||
: Variable(_name) { }
|
||||
|
||||
void evaluateInternal(Transaction *transaction,
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l);
|
||||
std::string m_plain;
|
||||
};
|
||||
|
||||
|
||||
} // namespace Variables
|
||||
} // namespace modsecurity
|
||||
|
||||
|
||||
Reference in New Issue
Block a user