summaryrefslogtreecommitdiff
path: root/server/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'server/util.c')
-rw-r--r--server/util.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/server/util.c b/server/util.c
index ac429c78..d0b90c6a 100644
--- a/server/util.c
+++ b/server/util.c
@@ -1589,7 +1589,7 @@ AP_DECLARE(int) ap_unescape_url(char *url)
return OK;
}
-AP_DECLARE(int) ap_unescape_url_keep2f(char *url)
+AP_DECLARE(int) ap_unescape_url_keep2f_ex(char *url, int decode_2f)
{
register int badesc, badpath;
char *x, *y;
@@ -1617,6 +1617,10 @@ AP_DECLARE(int) ap_unescape_url_keep2f(char *url)
if (decoded == '\0') {
badpath = 1;
}
+ else if (IS_SLASH(decoded) && !decode_2f) {
+ /* do not decode, just let it go by as-is */
+ *x = *y;
+ }
else {
*x = decoded;
y += 2;
@@ -1636,6 +1640,11 @@ AP_DECLARE(int) ap_unescape_url_keep2f(char *url)
}
}
+AP_DECLARE(int) ap_unescape_url_keep2f(char *url)
+{
+ return ap_unescape_url_keep2f_ex(url, 1);
+}
+
AP_DECLARE(char *) ap_construct_server(apr_pool_t *p, const char *hostname,
apr_port_t port, const request_rec *r)
{