]> granicus.if.org Git - apache/commitdiff
revert r1796447, this should be RTC.
authorEric Covener <covener@apache.org>
Sat, 27 May 2017 21:12:39 +0000 (21:12 +0000)
committerEric Covener <covener@apache.org>
Sat, 27 May 2017 21:12:39 +0000 (21:12 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1796453 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
server/util.c

diff --git a/CHANGES b/CHANGES
index fa9de1925e2bdf2b99dd4c73b085029b7b1f3471..18d5121f8d62c66e2e812b783e42f537779d9422 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -5,9 +5,6 @@ Changes with Apache 2.4.26
   *) core: EBCDIC fixes for interim responses with additional headers.
      [Eric Covener]
 
-  *) core: ap_parse_form_data() URL-decoding doesn't work on EBCDIC
-     platforms. PR61124. [Hank Ibell <hwibell gmail.com>]
-
   *) Evaluate nested If/ElseIf/Else configuration blocks.
      [Luca Toscano, Jacob Champion]
 
index 6667ac2e46394e23617eb25ed8dd8410fa9e05d2..fba34bde1a9b318681fca6a3a9d455e4745359f7 100644 (file)
@@ -2666,7 +2666,8 @@ AP_DECLARE(int) ap_parse_form_data(request_rec *r, ap_filter_t *f,
     ap_form_pair_t *pair = NULL;
     apr_array_header_t *pairs = apr_array_make(r->pool, 4, sizeof(ap_form_pair_t));
 
-    char escaped_char[2];
+    char hi = 0;
+    char low = 0;
 
     *ptr = pairs;
 
@@ -2733,13 +2734,30 @@ AP_DECLARE(int) ap_parse_form_data(request_rec *r, ap_filter_t *f,
                     continue;
                 }
                 if (FORM_PERCENTA == percent) {
-                    escaped_char[0] = c;
+                    if (c >= 'a') {
+                        hi = c - 'a' + 10;
+                    }
+                    else if (c >= 'A') {
+                        hi = c - 'A' + 10;
+                    }
+                    else if (c >= '0') {
+                        hi = c - '0';
+                    }
+                    hi = hi << 4;
                     percent = FORM_PERCENTB;
                     continue;
                 }
                 if (FORM_PERCENTB == percent) {
-                    escaped_char[1] = c;
-                    c = x2c(escaped_char);
+                    if (c >= 'a') {
+                        low = c - 'a' + 10;
+                    }
+                    else if (c >= 'A') {
+                        low = c - 'A' + 10;
+                    }
+                    else if (c >= '0') {
+                        low = c - '0';
+                    }
+                    c = low | hi;
                     percent = FORM_NORMAL;
                 }
                 switch (state) {