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: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]
          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.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to