Tk Library Source Code

View Ticket
Login
Ticket UUID: 593254
Title: setValue doesn't work right w/ multipart
Type: Bug Version: None
Submitter: davidw Created on: 2002-08-09 21:41:11
Subsystem: ncgi Assigned To: davidw
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2002-08-16 01:29:12
Resolution: Fixed Closed By: davidw
    Closed on: 2002-08-15 18:29:12
Description:
ncgi::setValue doesn't work right with multipart forms,
if you pass it a string with spaces in it, because of
the way it gets treated by ncgi::value.  See new test case.
User Comments: davidw added on 2002-08-16 01:29:12:
Logged In: YES 
user_id=240

Committed patch after approval from Brent.

davidw added on 2002-08-10 05:02:35:
Logged In: YES 
user_id=240

How does this look, as a patch, in setValue?


@@ -503,7 +503,15 @@
     if {![info exist value($key)]} {
        lappend varlist $key
     }
-    set value($key) $valuelist
+
+    # This if statement is a workaround for another hack in
+    # ncgi::value that treats multipart form data
+    # differently.
+    if {[string match multipart/* [ncgi::type]]} {
+       set value($key) [list [list {} [join $valuelist]]]
+    } else {
+       set value($key) $valuelist
+    }
     return ""
 }

If I don't hear back shortly, I will commit.  This makes it
pass the tests.