[Mono-bugs] [Bug 595140] New: WebConfigurationManager fails on path "~"

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Apr 9 05:10:34 EDT 2010


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

http://bugzilla.novell.com/show_bug.cgi?id=595140#c0


           Summary: WebConfigurationManager fails on path "~"
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.6.x
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Web
        AssignedTo: mhabersack at novell.com
        ReportedBy: avkekem at hotmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/533.2
(KHTML, like Gecko) Chrome/5.0.342.7 Safari/533.2

On .net the following sentence in an aspx page will go fine, but in mono it
fails using a substring out of index:
WebConfigurationManager.GetSection("system.web/authorization", "~")

The code in
mcs/class/System.Web/System.Web.Configuration_2.0/WebConfigurationManager.cs
should be:
               if (VirtualPathUtility.IsRooted (path)) {
                    if (path [0] == '~')
-                       relPath = path.Substring (2);
+                       relPath = path.Length > 1 ? path.Substring (2) : "";
                    else if (path [0] == '/')
                        relPath = path.Substring (1);
                    else
                        relPath = path;
                } else
                    relPath = path;


Reproducible: Always

Steps to Reproduce:
1.
2.
3.

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


More information about the mono-bugs mailing list