Author: mhabersack
Date: 2007-05-16 05:13:48 -0400 (Wed, 16 May 2007)
New Revision: 77463

Modified:
   trunk/mcs/class/System.Web/System.Web/ChangeLog
   trunk/mcs/class/System.Web/System.Web/HttpRequest.cs
Log:
2007-05-16  Marek Habersack  <[EMAIL PROTECTED]>

        * HttpRequest.cs: do not add duplicate fields to the form
        collection. Unbreaks the TreeView populate on demand sample from
        the XSP2 tests.


Modified: trunk/mcs/class/System.Web/System.Web/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web/ChangeLog     2007-05-16 08:47:10 UTC 
(rev 77462)
+++ trunk/mcs/class/System.Web/System.Web/ChangeLog     2007-05-16 09:13:48 UTC 
(rev 77463)
@@ -1,3 +1,9 @@
+2007-05-16  Marek Habersack  <[EMAIL PROTECTED]>
+
+       * HttpRequest.cs: do not add duplicate fields to the form
+       collection. Unbreaks the TreeView populate on demand sample from
+       the XSP2 tests.
+
 2007-05-15  Marek Habersack  <[EMAIL PROTECTED]>
 
        * HttpApplication.cs: refactoring - moved LoadType from

Modified: trunk/mcs/class/System.Web/System.Web/HttpRequest.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web/HttpRequest.cs        2007-05-16 
08:47:10 UTC (rev 77462)
+++ trunk/mcs/class/System.Web/System.Web/HttpRequest.cs        2007-05-16 
09:13:48 UTC (rev 77463)
@@ -524,7 +524,12 @@
                //
                void AddRawKeyValue (StringBuilder key, StringBuilder value)
                {
-                       form.Add (HttpUtility.UrlDecode (key.ToString (), 
ContentEncoding),
+                       string decodedKey = HttpUtility.UrlDecode (key.ToString 
(), ContentEncoding);
+                       if (form.Get (decodedKey) != null)
+                               // probably should warn about a duplicate here. 
Also, should we replace the old value instead?
+                               return;
+                       
+                       form.Add (decodedKey,
                                  HttpUtility.UrlDecode (value.ToString (), 
ContentEncoding));
 
                        key.Length = 0;

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to