[Mono-bugs] [Bug 507845] New: Uri.ToString() excessive unescaping

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu May 28 11:47:55 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=507845


           Summary: Uri.ToString() excessive unescaping
    Classification: Mono
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: em at nerd.ocracy.org
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=294989)
 --> (http://bugzilla.novell.com/attachment.cgi?id=294989)
Patch for mcs/class/System/System/Uri.cs

http://msdn.microsoft.com/en-us/library/system.uri.tostring.aspx specifies that
Uri.ToString() should return the Uri completely unescaped except for '?', '#'
and '%'.

Unfortunately the query component currently does not respect the exception
list, returning a bogus representation as can be shown by the following csharp
session (tested on SVN trunk):

csharp> new Uri("http://example.com/?foo=a%23b#fragment");
http://example.com/?foo=a#b#fragment
csharp>                        

Note how the "%23" has been turned to a '#', thus transforming part of a query
parameter in a fragment.

The attached simple patch should fix the problem:

csharp> new Uri("http://example.com/?foo=a%23b#fragment");
http://example.com/?foo=a%23b#fragment
csharp>

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list