From: Miguel de Icaza Date: Fri, 2 Nov 2007 04:41:25 +0000 (-0000) Subject: 2007-11-02 Miguel de Icaza X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=1447789b1199366e11bc0819ab3a280043da9430;p=mono.git 2007-11-02 Miguel de Icaza * 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 --- diff --git a/mcs/class/System/System/ChangeLog b/mcs/class/System/System/ChangeLog index 1c4cfc3fbe8..c9c1d0d267d 100644 --- a/mcs/class/System/System/ChangeLog +++ b/mcs/class/System/System/ChangeLog @@ -1,3 +1,11 @@ +2007-11-02 Miguel de Icaza + + * 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 * Uri.cs (ToString, MakeRelativeUri): refactor some code in diff --git a/mcs/class/System/System/Uri.cs b/mcs/class/System/System/Uri.cs index 3bf7ca8a0a2..ace6be30e08 100644 --- a/mcs/class/System/System/Uri.cs +++ b/mcs/class/System/System/Uri.cs @@ -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) diff --git a/mcs/class/System/Test/System/UriTest.cs b/mcs/class/System/Test/System/UriTest.cs index fbaa8e06a8e..4b5046f5029 100644 --- a/mcs/class/System/Test/System/UriTest.cs +++ b/mcs/class/System/Test/System/UriTest.cs @@ -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 () {