2009-01-26 Marek Habersack <mhabersack@novell.com>
authorMarek Habersack <grendel@twistedcode.net>
Mon, 26 Jan 2009 11:38:08 +0000 (11:38 -0000)
committerMarek Habersack <grendel@twistedcode.net>
Mon, 26 Jan 2009 11:38:08 +0000 (11:38 -0000)
* WebConfigurationHost.cs: when an attempt to map a fake virtual
path is made, MapPath returns the aplication physical root
directory. Fixes bug #463950

svn path=/trunk/mcs/; revision=124479

mcs/class/System.Web/System.Web.Configuration_2.0/ChangeLog
mcs/class/System.Web/System.Web.Configuration_2.0/WebConfigurationHost.cs

index db2df2a5ee2137de4d666ffcc3b21dcd0c724d27..ef9063fce58796b2c2dfdbb89c6c47a8c9e18ad8 100644 (file)
@@ -1,3 +1,9 @@
+2009-01-26  Marek Habersack  <mhabersack@novell.com>
+
+       * WebConfigurationHost.cs: when an attempt to map a fake virtual
+       path is made, MapPath returns the aplication physical root
+       directory. Fixes bug #463950
+
 2008-01-09  Dean Brettle  <dean@brettle.com>
 
        * nBrowser/Node.cs: Fixed compatibility bug where <identification> sections were required
index 7281e73d97234f6c57308924c9ec38480a095bbc..24cd3b01150530ebcc5bbb35763415652ceff83f 100644 (file)
@@ -216,6 +216,11 @@ namespace System.Web.Configuration
                
                public string MapPath (string virtualPath)
                {
+                       if (!String.IsNullOrEmpty (virtualPath)) {
+                               if (virtualPath.StartsWith (System.Web.Compilation.BuildManager.FAKE_VIRTUAL_PATH_PREFIX, StringComparison.Ordinal))
+                                       return HttpRuntime.AppDomainAppPath;
+                       }
+                       
                        if (map != null)
                                return MapPathFromMapper (virtualPath);
                        else if (HttpContext.Current != null && HttpContext.Current.Request != null)