-*- coding: utf-8 -*-
Changes with Apache 2.5.0
+ *) mod_rewrite: Don't implicitly URL-escape the original query string
+ when no substitution has changed it (like PR50447 but server context)
+ [Evgeny Kotkov <evgeny.kotkov visualsvn.com>]
+
*) core: New CGIVar directive can configure REQUEST_URI to represent the
current URI being processed instead of always the original request.
[Jeff Trawick]
unsigned int port;
int rulestatus;
void *skipdata;
+ const char *oargs;
/*
* retrieve the config structures
return DECLINED;
}
+ /*
+ * remember the original query string for later check, since we don't
+ * want to apply URL-escaping when no substitution has changed it.
+ */
+ oargs = r->args;
+
/*
* add the SCRIPT_URL variable to the env. this is a bit complicated
* due to the fact that apache uses subrequests and internal redirects
/* append the QUERY_STRING part */
if (r->args) {
+ char *escaped_args = NULL;
+ int noescape = (rulestatus == ACTION_NOESCAPE ||
+ (oargs && !strcmp(r->args, oargs)));
+
r->filename = apr_pstrcat(r->pool, r->filename, "?",
- (rulestatus == ACTION_NOESCAPE)
+ noescape
? r->args
- : ap_escape_uri(r->pool, r->args),
+ : (escaped_args =
+ ap_escape_uri(r->pool, r->args)),
NULL);
+
+ rewritelog((r, 1, NULL, "%s %s to query string for redirect %s",
+ noescape ? "copying" : "escaping",
+ r->args ,
+ noescape ? "" : escaped_args));
}
/* determine HTTP redirect response code */