Merge pull request #2781 from alexanderkyte/inflated_method_header_leak
[mono.git] / mcs / class / System.Web / System.Web.Compilation / PageBuildProvider.cs
index 4396a22f4508a4108c9ad959614edbfac0398864..66d84380667375436c7006591ced6b4c32d9a40e 100644 (file)
@@ -29,7 +29,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 
 using System;
 using System.CodeDom;
@@ -49,20 +48,20 @@ namespace System.Web.Compilation {
                {
                }
 
-               protected override string MapPath (string virtualPath)
+               protected override string MapPath (VirtualPath virtualPath)
                {
                        // We need this hack to support out-of-application wsdl helpers
-                       if (StrUtils.StartsWith (virtualPath, BuildManager.FAKE_VIRTUAL_PATH_PREFIX))
-                               return virtualPath.Substring (BuildManager.FAKE_VIRTUAL_PATH_PREFIX.Length);
+                       if (virtualPath.IsFake)
+                               return virtualPath.PhysicalPath;
 
                        return base.MapPath (virtualPath);
                }               
 
-               protected override TextReader SpecialOpenReader (string virtualPath, out string physicalPath)
+               protected override TextReader SpecialOpenReader (VirtualPath virtualPath, out string physicalPath)
                {
                        // We need this hack to support out-of-application wsdl helpers
-                       if (StrUtils.StartsWith (virtualPath, BuildManager.FAKE_VIRTUAL_PATH_PREFIX)) {
-                               physicalPath = virtualPath.Substring (BuildManager.FAKE_VIRTUAL_PATH_PREFIX.Length);
+                       if (virtualPath.IsFake) {
+                               physicalPath = virtualPath.PhysicalPath;
                                return new StreamReader (physicalPath);
                        } else
                                physicalPath = null;
@@ -75,16 +74,16 @@ namespace System.Web.Compilation {
                        return new PageCompiler (parser as PageParser);
                }
 
-               protected override TemplateParser CreateParser (string virtualPath, string physicalPath, HttpContext context)
+               protected override TemplateParser CreateParser (VirtualPath virtualPath, string physicalPath, HttpContext context)
                {       
-                       return CreateParser (virtualPath, physicalPath, OpenReader (virtualPath), context);
+                       return CreateParser (virtualPath, physicalPath, OpenReader (virtualPath.Original), context);
                }
                
-               protected override TemplateParser CreateParser (string virtualPath, string physicalPath, TextReader reader, HttpContext context)
+               protected override TemplateParser CreateParser (VirtualPath virtualPath, string physicalPath, TextReader reader, HttpContext context)
                {
                        return new PageParser (virtualPath, physicalPath, reader, context);
                }
        }
 }
-#endif
+