Author: mhabersack
Date: 2008-02-05 08:02:41 -0500 (Tue, 05 Feb 2008)
New Revision: 94878

Modified:
   trunk/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs
   trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog
Log:
2008-02-05  Marek Habersack  <[EMAIL PROTECTED]>

        * BuildManager.cs: GetAbsoluteVirtualPath correctly converts
        non-rooted relative paths to absolute ones now. Fixes bug
        #357504.


Modified: trunk/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs   
2008-02-05 12:51:02 UTC (rev 94877)
+++ trunk/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs   
2008-02-05 13:02:41 UTC (rev 94878)
@@ -373,9 +373,15 @@
                {
                        string vp;
 
-                       if (!VirtualPathUtility.IsRooted (virtualPath))
-                               vp = "~/" + virtualPath;
-                       else
+                       if (!VirtualPathUtility.IsRooted (virtualPath)) {
+                               HttpContext ctx = HttpContext.Current;
+                               HttpRequest req = ctx != null ? ctx.Request : 
null;
+
+                               if (req != null)
+                                       vp = VirtualPathUtility.GetDirectory 
(req.FilePath) + virtualPath;
+                               else
+                                       throw new HttpException ("No context, 
cannot map paths.");
+                       } else
                                vp = virtualPath;
                        
                        if (VirtualPathUtility.IsAppRelative (vp))
@@ -414,8 +420,8 @@
                public static Type GetCompiledType (string virtualPath)
                {
                        string vp = GetAbsoluteVirtualPath (virtualPath);
-                       
                        BuildCacheItem ret = GetCachedItem (vp);
+
                        if (ret != null)
                                return ret.type;
                        

Modified: trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog 2008-02-05 
12:51:02 UTC (rev 94877)
+++ trunk/mcs/class/System.Web/System.Web.Compilation/ChangeLog 2008-02-05 
13:02:41 UTC (rev 94878)
@@ -1,5 +1,9 @@
 2008-02-05  Marek Habersack  <[EMAIL PROTECTED]>
 
+       * BuildManager.cs: GetAbsoluteVirtualPath correctly converts
+       non-rooted relative paths to absolute ones now. Fixes bug
+       #357504.
+
        * GenericBuildProvider.cs: introduced a new abstract method,
        GetReferencedAssemblies, which is called on descendant builders to
        get a list of assemblies referenced by the parsed file. Fixes bug

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to