Joe Schaefer wrote:
The apreq developers are planning a maintenance release of
libapreq-1.1.  This version does not include support for
modperl-2, but it does address some outstanding problems in
1.0:
I have made the below patch to make Apache::Request behave like CGI.pm when parsing multi-valued http POST data. Without the patch the matching of the variable names is case insensitive this results in a multi valued list instead of two separate hash entries if the following fragment is posted.

<input type="hidden" name="GOTO" value="up">
<input type="hidden" name="goto" value="down">

Since the keys in perl hashes are case sensitive it makes no sense to believe that the above two keys should create a multivalued enty and not two entries, one with key 'GOTO' and the other with 'goto'.

To make matters worse actual case used for the resulting multivalued key is only dependent on which field that was parsed first!

/Martin


--
Martin Nilsson, Civilingenjör M.Sc. CS&E
Svenska Butiker AB,
S:t Larsväg 44, 222 70 Lund, Sweden
[EMAIL PROTECTED]
Phone: +46-46-304130
http://www.svenskabutiker.se
--- Request/Request.xs.org      Sun Jan 20 18:27:35 2002
+++ Request/Request.xs  Wed Sep 11 18:11:11 2002
@@ -400,7 +400,7 @@
                array_header *arr  = ap_table_elts(req->parms);
                table_entry *elts = (table_entry *)arr->elts;
                for (i = 0; i < arr->nelts; ++i) {
-                   if (elts[i].key && strcaseEQ(elts[i].key, key))
+                   if (elts[i].key && strEQ(elts[i].key, key))
                        XPUSHs(sv_2mortal(newSVpv(elts[i].val,0)));
                }
            }
@@ -429,7 +429,7 @@
                   if (!elts[i].key) continue;
                    /* simple but inefficient uniqueness check */
                    for (j = 0; j < i; ++j) { 
-                       if (strcaseEQ(elts[i].key, elts[j].key))
+                       if (strEQ(elts[i].key, elts[j].key))
                            break;
                    }
                    if ( i == j )


Reply via email to