Merge revision 103449, fix TD bug 10485
authorNoam Lampert <noaml@mono-cvs.ximian.com>
Mon, 19 May 2008 07:18:35 +0000 (07:18 -0000)
committerNoam Lampert <noaml@mono-cvs.ximian.com>
Mon, 19 May 2008 07:18:35 +0000 (07:18 -0000)
svn path=/branches/mainsoft/gh2.2/mcs/; revision=103450

mcs/class/System.Web/System.Web/ChangeLog
mcs/class/System.Web/System.Web/HttpServerUtility.cs
mcs/class/System.Web/Test/System.Web/HttpServerUtilityTest.cs
mcs/class/System.Web/Test/System.Web/HttpUtilityTest.cs

index 26d5d9193c6d49dfe0692c3b7d30fdfd4374047a..ea5b487cd1cbfb1625f05744fdd17e69223f8467 100644 (file)
@@ -1,3 +1,8 @@
+
+2008-05-19 Noam Lampert <noaml@mainsoft.com>
+
+        * HttpServerUtility.cs: Fix bug in UrlPathEncode when URL contains '?' 
+
 2008-02-24  Vladimir Krasnov  <vladimirk@mainsoft.com>
 
        * HttpContext.cs: made GetResourceObject method internal
index 228e86b9fddaf236871e25d630a257b43c27ddde..6ac796a319b0e33e233d85f5bb289d000fe20122 100644 (file)
@@ -356,7 +356,7 @@ namespace System.Web {
                        int idx = s.IndexOf ("?");
                        string s2 = null;
                        if (idx != -1) {
-                               s2 = s.Substring (0, idx-1);
+                               s2 = s.Substring (0, idx);
                                s2 = HttpUtility.UrlEncode (s2) + s.Substring (idx);
                        } else {
                                s2 = HttpUtility.UrlEncode (s);
index 9d93ed9a3c951ca4aa45c53f684a1023c7147a56..a6a48011253f31c8a3501d7cc30f37e7512f5737 100644 (file)
@@ -84,5 +84,14 @@ namespace MonoTests.System.Web {
                        windata = Encoding.Convert (Encoding.UTF8, win1251, utf8data);
                        Assert.AreEqual ("&#65308;script&#65310;", Encoding.ASCII.GetString (windata), "ok");
                }
+
+               [Test]
+               public void UrlPathEncode2()
+               {
+                       string s = "default.xxx?sdsd=sds";
+                       string s2 = Server.UrlPathEncode(s);
+                       Assert.AreEqual(s, s2, "UrlPathEncode " + s);
+               }               
+
        }
 }
index 501ff3344a06695ec69802c36aa5c76488e05c54..fc55cb5a050a5df07468878611f04d57ec7cd9fc 100644 (file)
@@ -478,6 +478,13 @@ namespace MonoTests.System.Web {
                                Assert.AreEqual (exp, act, "UrlPathEncode " + c.ToString ());
                        }
                }
+        [Test]
+        public void UrlPathEncode2()
+        {
+            string s = "default.xxx?sdsd=sds";
+            string s2 = HttpUtility.UrlPathEncode(s);
+            Assert.AreEqual(s, s2, "UrlPathEncode " + s);
+        }
 
 #endif