2007-11-02 Miguel de Icaza <miguel@novell.com>
authorMiguel de Icaza <miguel@gnome.org>
Fri, 2 Nov 2007 04:41:25 +0000 (04:41 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Fri, 2 Nov 2007 04:41:25 +0000 (04:41 -0000)
* Uri.cs (AppendQueryAndFragment): Unescape the query with
excludeSpecial = false.  See bug #320614.

Unlike the patch on that bug, this only unescapes the query and
not the Path.   This keeps our existing tests working.

svn path=/trunk/mcs/; revision=88711

mcs/class/System/System/ChangeLog
mcs/class/System/System/Uri.cs
mcs/class/System/Test/System/UriTest.cs

index 1c4cfc3fbe8a5a590bf1582d4205b4f37042748b..c9c1d0d267d3803b91c7e0ee4760959522ebcdec 100644 (file)
@@ -1,3 +1,11 @@
+2007-11-02  Miguel de Icaza  <miguel@novell.com>
+
+       * Uri.cs (AppendQueryAndFragment): Unescape the query with
+       excludeSpecial = false.  See bug #320614.
+
+       Unlike the patch on that bug, this only unescapes the query and
+       not the Path.   This keeps our existing tests working. 
+
 2007-09-29  Miguel de Icaza  <miguel@novell.com>
 
        * Uri.cs (ToString, MakeRelativeUri): refactor some code in
index 3bf7ca8a0a222e72a44cd0f1d664e61caf086da5..ace6be30e0896319a7d2ae483bb3bef87138f43a 100644 (file)
@@ -1015,7 +1015,7 @@ namespace System {
                void AppendQueryAndFragment (ref string result)
                {
                        if (query.Length > 0) {
-                               string q = query [0] == '?' ? '?' + Unescape (query.Substring (1), true) : Unescape (query, true);
+                               string q = query [0] == '?' ? '?' + Unescape (query.Substring (1), false) : Unescape (query, false);
                                result += q;
                        }
                        if (fragment.Length > 0)
index fbaa8e06a8eb831e5b9a0f9c3e331448e6393fa2..4b5046f5029aac5a4b8fc1b37fa6395ac7105049 100644 (file)
@@ -702,6 +702,17 @@ namespace MonoTests.System
                                AssertEquals ("#9d", "file:///foo%25bar", uri.ToString ());
                        }
                }
+
+               // Novell Bugzilla #320614
+               [Test]
+               public void QueryEscape ()
+               {
+                       Uri u1 = new Uri("http://localhost:8080/test.aspx?ReturnUrl=%2fSearchDoc%2fSearcher.aspx");
+                       Uri u2 = new Uri("http://localhost:8080/test.aspx?ReturnUrl=%252fSearchDoc%252fSearcher.aspx");
+                       
+                       AssertEquals ("QE1", u1.ToString (), "http://localhost:8080/test.aspx?ReturnUrl=/SearchDoc/Searcher.aspx");
+                       AssertEquals ("QE2", u2.ToString (), "http://localhost:8080/test.aspx?ReturnUrl=%2fSearchDoc%2fSearcher.aspx");
+               }
                
                [Test]
                public void UnixPath () {