Bläddra i källkod

2009-10-12 Marek Habersack <[email protected]>

	* BuildManager.cs: make sure to construct correct physical path
	for every precompiled key in FixVirtualPaths. Fixes bug #546053

svn path=/trunk/mcs/; revision=143950
Marek Habersack 16 år sedan
förälder
incheckning
1e532930f2

+ 5 - 1
mcs/class/System.Web/System.Web.Compilation/BuildManager.cs

@@ -169,7 +169,10 @@ namespace System.Web.Compilation {
 				for (int i = 0; i < parts.Length; i++) {
 					if (String.IsNullOrEmpty (parts [i]))
 						continue;
-					string test_path = String.Join ("/", parts, i, parts.Length - i);
+					// The path must be rooted, otherwise PhysicalPath returned
+					// below will be relative to the current request path and
+					// File.Exists will return a false negative. See bug #546053
+					string test_path = "/" + String.Join ("/", parts, i, parts.Length - i);
 					VirtualPath result = GetAbsoluteVirtualPath (test_path);
 					if (result != null && File.Exists (result.PhysicalPath)) {
 						skip = i - 1;
@@ -177,6 +180,7 @@ namespace System.Web.Compilation {
 					}
 				}
 			}
+			
 			string app_vpath = HttpRuntime.AppDomainAppVirtualPath;
 			if (skip == -1 || (skip == 0 && app_vpath == "/"))
 				return;

+ 5 - 0
mcs/class/System.Web/System.Web.Compilation/ChangeLog

@@ -1,3 +1,8 @@
+2009-10-12  Marek Habersack  <[email protected]>
+
+	* BuildManager.cs: make sure to construct correct physical path
+	for every precompiled key in FixVirtualPaths. Fixes bug #546053
+
 2009-09-30 Gonzalo Paniagua Javier <[email protected]>
 
 	* BuildManager.cs: load/set the global resources assembly for