[Mono-bugs] [Bug 54400][Nor] New - UrlUtils.ResolveUrl does not properly replace ~ with AppPath

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 15 Feb 2004 10:37:14 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by jonwagner@hotmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=54400

--- shadow/54400	2004-02-15 10:37:14.000000000 -0500
+++ shadow/54400.tmp.31990	2004-02-15 10:37:14.000000000 -0500
@@ -0,0 +1,46 @@
+Bug#: 54400
+Product: Mono/Class Libraries
+Version: unspecified
+OS: Red Hat 9.0
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.Web
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: jonwagner@hotmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: UrlUtils.ResolveUrl does not properly replace ~ with AppPath
+
+Description of Problem:
+
+When using the apppath character ~ in a url in an ascx that is not in the 
+application root, the ~ is replaced by the ascx directory instead of the 
+application path.
+
+Steps to reproduce the problem:
+1. Create an aspx in an application root, e.g. /ema/default.aspx
+2. Create an ascx in a subdirectory e.g. /ema/Logon/Logon.ascx and include 
+it in the page from step 1.
+3. Create an img tag in the ascx with an app path e.g. <img 
+src="~/Images/foo.gif" runat="server" />
+
+Actual Results:
+
+img tag outputs /ema/Images/Logon/foo.gif
+
+Expected Results:
+
+img tag should output /ema/Images/foo.gif
+
+Additional Information:
+
+The problem is in the UrlUtils.ResolveUrl method. When it processes the ~, 
+it uses the basePath parameter instead of 
+HttpRuntime.AppDomainAppVirtualPath.
+
+Proposed patch attached.