mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 11:16:33 +03:00
Change from TX:LAST_MATCHED_VAR_NAME to MATCHED_VAR. See #123.
This commit is contained in:
17
apache2/re.c
17
apache2/re.c
@@ -1335,8 +1335,6 @@ static int execute_operator(msre_var *var, msre_rule *rule, modsec_rec *msr,
|
||||
else {
|
||||
/* Match. */
|
||||
|
||||
msc_string *s = (msc_string *)apr_pcalloc(msr->mp, sizeof(msc_string));
|
||||
|
||||
if (rc == 0) {
|
||||
/* Operator did not match so we need to provide a message. */
|
||||
my_error_msg = apr_psprintf(msr->mp, "Match of \"%s %s\" against \"%s\" required.",
|
||||
@@ -1346,21 +1344,6 @@ static int execute_operator(msre_var *var, msre_rule *rule, modsec_rec *msr,
|
||||
|
||||
msr->matched_var = apr_pstrdup(msr->mp, var->name);
|
||||
|
||||
if (s == NULL) {
|
||||
msr_log(msr, 3, "Internal error: Failed to allocate space for TX.last_matched_var_name.");
|
||||
}
|
||||
else {
|
||||
s->name = "last_matched_var_name";
|
||||
s->value = apr_pstrdup(msr->mp, var->name);
|
||||
s->value_len = strlen(var->name);
|
||||
if ((s->name == NULL)||(s->value == NULL)) return -1;
|
||||
apr_table_setn(msr->tx_vars, s->name, (void *)s);
|
||||
if (msr->txcfg->debuglog_level >= 9) {
|
||||
msr_log(msr, 9, "Added matched variable name to TX.%s: %s", s->name, var->name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Keep track of the highest severity matched so far */
|
||||
if ((acting_actionset->severity > 0) && (acting_actionset->severity < msr->highest_severity))
|
||||
{
|
||||
|
Reference in New Issue
Block a user