-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Allow \ in setvar #3519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v2/master
Are you sure you want to change the base?
Allow \ in setvar #3519
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -991,7 +991,7 @@ | |
| * It breaks up the input string into name-parameter pairs and places | ||
| * them into the given table. | ||
| */ | ||
| int msre_parse_generic(apr_pool_t *mp, const char *text, apr_table_t *vartable, | ||
|
Check failure on line 994 in apache2/re.c
|
||
| char **error_msg) | ||
| { | ||
| char *p = (char *)text; | ||
|
|
@@ -1075,13 +1075,13 @@ | |
| return -1; | ||
| } else | ||
| if (*p == '\\') { | ||
| if ( (*(p + 1) == '\0') || ((*(p + 1) != '\'')&&(*(p + 1) != '\\')) ) { | ||
| if ((*(p + 1) == '\0')) { | ||
| *error_msg = apr_psprintf(mp, "Invalid quoted pair at position %d: %s", | ||
| (int)(p - text), text); | ||
| free(value); | ||
| return -1; | ||
| } | ||
| p++; | ||
| if ((*(p + 1) == '\'') || (*(p + 1) == '\\')) p++; // compatibility with previous behaviour | ||
| *(d++) = *(p++); | ||
|
Comment on lines
+1078
to
1085
|
||
| } else | ||
| if (*p == '\'') { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is in
msre_parse_generic()(used for both target and action parsing), so it relaxes backslash handling for all quoted parameters—not justsetvar. If the intent is setvar-only, consider moving this logic into the setvar parser; otherwise please update the PR title/description to reflect the broader behavioral change.