Kill UmbracoContext.Current

This commit is contained in:
Stephan
2019-02-14 09:49:45 +01:00
parent 969c2aa184
commit abceda7750
35 changed files with 121 additions and 110 deletions

View File

@@ -1,4 +1,5 @@
using System.Web;
using Umbraco.Web.Composing;
namespace Umbraco.Web.Routing
{
@@ -28,7 +29,7 @@ namespace Umbraco.Web.Routing
response.Clear();
var frequest = UmbracoContext.Current.PublishedRequest;
var frequest = Current.UmbracoContext.PublishedRequest;
var reason = "Cannot render the page at url '{0}'.";
if (frequest.HasPublishedContent == false)
reason = "No umbraco document matches the url '{0}'.";
@@ -37,7 +38,7 @@ namespace Umbraco.Web.Routing
response.Write("<html><body><h1>Page not found</h1>");
response.Write("<h3>");
response.Write(string.Format(reason, HttpUtility.HtmlEncode(UmbracoContext.Current.OriginalRequestUrl.PathAndQuery)));
response.Write(string.Format(reason, HttpUtility.HtmlEncode(Current.UmbracoContext.OriginalRequestUrl.PathAndQuery)));
response.Write("</h3>");
if (string.IsNullOrWhiteSpace(_message) == false)
response.Write("<p>" + _message + "</p>");