diff --git a/src/Umbraco.Core/ApplicationContext.cs b/src/Umbraco.Core/ApplicationContext.cs index 776714b839..a76f7784f2 100644 --- a/src/Umbraco.Core/ApplicationContext.cs +++ b/src/Umbraco.Core/ApplicationContext.cs @@ -100,6 +100,18 @@ namespace Umbraco.Core } } + /// + /// The original/first url that the web application executes + /// + /// + /// we need to set the initial url in our ApplicationContext, this is so our keep alive service works and this must + /// exist on a global context because the keep alive service doesn't run in a web context. + /// we are NOT going to put a lock on this because locking will slow down the application and we don't really care + /// if two threads write to this at the exact same time during first page hit. + /// see: http://issues.umbraco.org/issue/U4-2059 + /// + internal string OriginalRequestUrl { get; set; } + private bool Configured { get @@ -140,7 +152,6 @@ namespace Umbraco.Core } } - private void AssertIsReady() { if (!this.IsReady) diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 7380696087..673a6d4f56 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -258,6 +258,15 @@ default.aspx + ASPXCodeBehind + + + noNodes.aspx + ASPXCodeBehind + + + noNodes.aspx + ASPXCodeBehind diff --git a/src/Umbraco.Web.UI/config/splashes/NoNodes.aspx.cs b/src/Umbraco.Web.UI/config/splashes/NoNodes.aspx.cs new file mode 100644 index 0000000000..503c53a9f3 --- /dev/null +++ b/src/Umbraco.Web.UI/config/splashes/NoNodes.aspx.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.WebPages; + +namespace Umbraco.Web.UI.Config.Splashes +{ + public partial class NoNodes : System.Web.UI.Page + { + + protected override void OnInit(EventArgs e) + { + base.OnInit(e); + + var store = UmbracoContext.Current.RoutingContext.PublishedContentStore; + if (store.HasContent(UmbracoContext.Current)) + { + //if there is actually content, go to the root + Response.Redirect("~/"); + } + } + + } +} \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/channels/wlwmanifest.aspx.designer.cs b/src/Umbraco.Web.UI/config/splashes/NoNodes.aspx.designer.cs similarity index 64% rename from src/Umbraco.Web/umbraco.presentation/umbraco/channels/wlwmanifest.aspx.designer.cs rename to src/Umbraco.Web.UI/config/splashes/NoNodes.aspx.designer.cs index d14ea3a40c..0063e40629 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/channels/wlwmanifest.aspx.designer.cs +++ b/src/Umbraco.Web.UI/config/splashes/NoNodes.aspx.designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // @@ -7,18 +7,18 @@ // //------------------------------------------------------------------------------ -namespace umbraco.presentation.channels { +namespace Umbraco.Web.UI.Config.Splashes { - public partial class wlwmanifest { + public partial class NoNodes { /// - /// xhtml control. + /// Form1 control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Literal xhtml; + protected global::System.Web.UI.HtmlControls.HtmlForm Form1; } } diff --git a/src/Umbraco.Web.UI/config/splashes/noNodes.aspx b/src/Umbraco.Web.UI/config/splashes/noNodes.aspx index 49ef40210c..d4352b57a0 100644 --- a/src/Umbraco.Web.UI/config/splashes/noNodes.aspx +++ b/src/Umbraco.Web.UI/config/splashes/noNodes.aspx @@ -1,183 +1,149 @@ -<%@ Page Language="C#" AutoEventWireup="true" Inherits="System.Web.UI.Page" %> +<%@ Page Language="C#" AutoEventWireup="True" Inherits="Umbraco.Web.UI.Config.Splashes.NoNodes" CodeBehind="NoNodes.aspx.cs" %> <%@ Import Namespace="Umbraco.Core.Configuration" %> +<%@ Import Namespace="Umbraco.Core.IO" %> - - - Umbraco - <%=UmbracoVersion.Current.ToString(3)%> - - no pages found + + Umbraco - no pages found " /> - + - + - + - - - + + + - - - - - - + +
- + -
+
-
+
- + - + - + - +
+
+

Looks like there's still work to do

+

+ You're seeing the wonderful page because your website doesn't contain any published content yet. +

+

+ So get rid of this page by starting umbraco and publishing some content. You can do this by clicking the "set up your new website" button below. +

+ +
+
+
+   +
+
+
- -
- - - - -
-
- -
-
- -
- -
-
- -
- -
-
- -
- -
-
- -
- - -
-
- -
- + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Umbraco.Web.UI/umbraco/channels/rsd.aspx b/src/Umbraco.Web.UI/umbraco/channels/rsd.aspx index 20ec1882e8..98f32ff992 100644 --- a/src/Umbraco.Web.UI/umbraco/channels/rsd.aspx +++ b/src/Umbraco.Web.UI/umbraco/channels/rsd.aspx @@ -1,11 +1,20 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="rsd.aspx.cs" Inherits="umbraco.presentation.umbraco.channels.rsd" %> + +<%@ Page Language="C#" AutoEventWireup="true" Inherits="System.Web.UI.Page" %> +<%@ Import Namespace="Umbraco.Core.IO" %> + + umbraco http://umbraco.org/ http://<%=Request.ServerVariables["SERVER_NAME"]%> - <%=umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco) %>/channels.aspx" /> - <%=umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco) %>/channels.aspx" /> + <%=IOHelper.ResolveUrl(SystemDirectories.Umbraco) %>/channels.aspx" /> + <%=IOHelper.ResolveUrl(SystemDirectories.Umbraco) %>/channels.aspx" /> - + \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/channels/wlwmanifest.aspx b/src/Umbraco.Web.UI/umbraco/channels/wlwmanifest.aspx index c14d5fa55d..9f4d7a135b 100644 --- a/src/Umbraco.Web.UI/umbraco/channels/wlwmanifest.aspx +++ b/src/Umbraco.Web.UI/umbraco/channels/wlwmanifest.aspx @@ -1,11 +1,33 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="wlwmanifest.aspx.cs" Inherits="umbraco.presentation.channels.wlwmanifest" %> + +<%@ Page Language="C#" AutoEventWireup="true" Inherits="System.Web.UI.Page" %> +<%@ Import Namespace="Umbraco.Core.IO" %> +<%@ Import Namespace="umbraco" %> + + http://umbraco.org/images/liveWriterIcon.png http://umbraco.org/images/liveWriterWatermark.png View your site/weblog Edit your site/weblog - {blog-homepage-url}<%= umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco) %>/ - {blog-homepage-url}<%= umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco)%>/actions/editContent.aspx?id={post-id} + {blog-homepage-url}<%= IOHelper.ResolveUrl(SystemDirectories.Umbraco) %>/ + {blog-homepage-url}<%= IOHelper.ResolveUrl(SystemDirectories.Umbraco)%>/actions/editContent.aspx?id={post-id} @@ -25,4 +47,5 @@ Yes Yes - \ No newline at end of file + + diff --git a/src/Umbraco.Web.UI/umbraco/ping.aspx b/src/Umbraco.Web.UI/umbraco/ping.aspx index d411738f90..945e59c3f8 100644 --- a/src/Umbraco.Web.UI/umbraco/ping.aspx +++ b/src/Umbraco.Web.UI/umbraco/ping.aspx @@ -1,2 +1,2 @@ -<%@ Page language="c#" Codebehind="ping.aspx.cs" AutoEventWireup="True" Inherits="umbraco.presentation.ping" %> +<%@ Page language="c#" Codebehind="ping.aspx.cs" AutoEventWireup="True" Inherits="System.Web.UI.Page" %> I'm alive! \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/settings/modals/ShowUmbracoTags.aspx b/src/Umbraco.Web.UI/umbraco/settings/modals/ShowUmbracoTags.aspx index ffa0426ec6..9663dc6e15 100644 --- a/src/Umbraco.Web.UI/umbraco/settings/modals/ShowUmbracoTags.aspx +++ b/src/Umbraco.Web.UI/umbraco/settings/modals/ShowUmbracoTags.aspx @@ -1,6 +1,7 @@ <%@ Page Language="c#" MasterPageFile="../../masterpages/umbracoPage.Master" Title="ShowUmbracoTags" Codebehind="ShowUmbracoTags.aspx.cs" AutoEventWireup="True" Inherits="umbraco.cms.presentation.settings.modal.ShowUmbracoTags" %> +<%@ Import Namespace="Umbraco.Core.IO" %> <%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> @@ -44,9 +45,9 @@ MetaBlogApi / Content Channels - <link rel="EditURI" type="application/rsd+xml" href="http://<%=Request.ServerVariables["SERVER_NAME"] %><%= umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco)%>/channels/rsd.aspx" /> + <link rel="EditURI" type="application/rsd+xml" href="http://<%=Request.ServerVariables["SERVER_NAME"] %><%= IOHelper.ResolveUrl(SystemDirectories.Umbraco)%>/channels/rsd.aspx" />

- <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://<%=Request.ServerVariables["SERVER_NAME"] %><%= umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco)%>/channels/wlwmanifest.aspx" /> + <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://<%=Request.ServerVariables["SERVER_NAME"] %><%= IOHelper.ResolveUrl(SystemDirectories.Umbraco)%>/channels/wlwmanifest.aspx" />
Insert the above two elements to the head element to gain optimal support for diff --git a/src/Umbraco.Web/LegacyScheduledTasks.cs b/src/Umbraco.Web/LegacyScheduledTasks.cs index f79b383b06..fb3ffc7d56 100644 --- a/src/Umbraco.Web/LegacyScheduledTasks.cs +++ b/src/Umbraco.Web/LegacyScheduledTasks.cs @@ -39,10 +39,10 @@ namespace Umbraco.Web // of course we should have a proper scheduler, see #U4-809 // ping/keepalive - _pingTimer = new Timer(new TimerCallback(global::umbraco.presentation.keepAliveService.PingUmbraco), umbracoApplication.Context, 60000, 300000); + pingTimer = new Timer(new TimerCallback(global::umbraco.presentation.keepAliveService.PingUmbraco), applicationContext, 60000, 300000); // (un)publishing _and_ also run scheduled tasks (!) - _publishingTimer = new Timer(new TimerCallback(global::umbraco.presentation.publishingService.CheckPublishing), umbracoApplication.Context, 30000, 60000); + publishingTimer = new Timer(new TimerCallback(global::umbraco.presentation.publishingService.CheckPublishing), applicationContext, 30000, 60000); // log scrubbing AddTask(LOG_SCRUBBER_TASK_NAME, GetLogScrubbingInterval()); diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index d75f21371f..242c932dcd 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -357,6 +357,15 @@ + + ASPXCodeBehind + + + ASPXCodeBehind + + + ASPXCodeBehind + ASPXCodeBehind @@ -662,21 +671,7 @@ - - ASPXCodeBehind - rsd.aspx - - - rsd.aspx - - - ASPXCodeBehind - wlwmanifest.aspx - - - wlwmanifest.aspx - @@ -1424,13 +1419,6 @@ Code - - ping.aspx - ASPXCodeBehind - - - ping.aspx - @@ -1913,8 +1901,6 @@ - - @@ -2061,9 +2047,6 @@ Form - - Form - Designer @@ -2076,7 +2059,9 @@ ASPXCodeBehind - + + ASPXCodeBehind + ASPXCodeBehind diff --git a/src/Umbraco.Web/UmbracoModule.cs b/src/Umbraco.Web/UmbracoModule.cs index 2e0af2d74e..abe135a865 100644 --- a/src/Umbraco.Web/UmbracoModule.cs +++ b/src/Umbraco.Web/UmbracoModule.cs @@ -10,10 +10,10 @@ using System.Web.Mvc; using System.Web.Routing; using System.Web.UI; using Umbraco.Core; +using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Web.Routing; using umbraco; -using umbraco.IO; using GlobalSettings = Umbraco.Core.Configuration.GlobalSettings; using UmbracoSettings = Umbraco.Core.Configuration.UmbracoSettings; @@ -35,6 +35,16 @@ namespace Umbraco.Web /// void BeginRequest(HttpContextBase httpContext) { + //we need to set the initial url in our ApplicationContext, this is so our keep alive service works and this must + //exist on a global context because the keep alive service doesn't run in a web context. + //we are NOT going to put a lock on this because locking will slow down the application and we don't really care + //if two threads write to this at the exact same time during first page hit. + //see: http://issues.umbraco.org/issue/U4-2059 + if (ApplicationContext.Current.OriginalRequestUrl.IsNullOrWhiteSpace()) + { + ApplicationContext.Current.OriginalRequestUrl = string.Format("{0}:{1}{2}", httpContext.Request.ServerVariables["SERVER_NAME"], httpContext.Request.ServerVariables["SERVER_PORT"], IOHelper.ResolveUrl(SystemDirectories.Umbraco)); + } + // do not process if client-side request if (IsClientSideRequest(httpContext.Request.Url)) return; diff --git a/src/Umbraco.Web/umbraco.presentation/install/utills/p.aspx.cs b/src/Umbraco.Web/umbraco.presentation/install/utills/p.aspx.cs index 4e8cde9b0c..be4389b11e 100644 --- a/src/Umbraco.Web/umbraco.presentation/install/utills/p.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/install/utills/p.aspx.cs @@ -15,6 +15,12 @@ namespace umbraco.presentation.install.utills { LogHelper.Info

(string.Format("Hitting Page_Load on p.aspx for the requested '{0}' feed", Request.QueryString["feed"])); + //if its not configured then we can continue + if (ApplicationContext.Current == null || ApplicationContext.Current.IsConfigured) + { + throw new AuthenticationException("The application is already configured"); + } + // Stop Caching in IE Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache); diff --git a/src/Umbraco.Web/umbraco.presentation/keepAliveService.cs b/src/Umbraco.Web/umbraco.presentation/keepAliveService.cs index 44cca4e7e4..4ab1646a9e 100644 --- a/src/Umbraco.Web/umbraco.presentation/keepAliveService.cs +++ b/src/Umbraco.Web/umbraco.presentation/keepAliveService.cs @@ -2,29 +2,35 @@ using System; using System.Diagnostics; using System.Net; using System.Web; +using Umbraco.Core; +using Umbraco.Core.Logging; namespace umbraco.presentation { ///

- /// Summary description for keepAliveService. + /// Makes a call to /umbraco/ping.aspx which is used to keep the web app alive /// public class keepAliveService { + //NOTE: sender will be the umbraco ApplicationContext public static void PingUmbraco(object sender) { - if (sender == null) + if (sender == null || !(sender is ApplicationContext)) return; - string url = string.Format("http://{0}/ping.aspx", ((HttpContext)sender).Application["umbracoUrl"]); + + var appContext = (ApplicationContext) sender; + + var url = string.Format("http://{0}/ping.aspx", appContext.OriginalRequestUrl); try { - using (WebClient wc = new WebClient()) + using (var wc = new WebClient()) { wc.DownloadString(url); } } catch(Exception ee) { - Debug.Write(string.Format("Error in ping({0}) -> {1}", url, ee)); + LogHelper.Debug(string.Format("Error in ping({0}) -> {1}", url, ee)); } } } diff --git a/src/Umbraco.Web/umbraco.presentation/publishingService.cs b/src/Umbraco.Web/umbraco.presentation/publishingService.cs index f1d30e7005..75f860b59f 100644 --- a/src/Umbraco.Web/umbraco.presentation/publishingService.cs +++ b/src/Umbraco.Web/umbraco.presentation/publishingService.cs @@ -15,14 +15,15 @@ namespace umbraco.presentation /// public class publishingService { - private static Hashtable scheduledTaskTimes = new Hashtable(); - private static bool isPublishingRunning = false; + private static readonly Hashtable ScheduledTaskTimes = new Hashtable(); + private static bool _isPublishingRunning = false; + //NOTE: sender will be the umbraco ApplicationContext public static void CheckPublishing(object sender) { - if(isPublishingRunning) + if(_isPublishingRunning) return; - isPublishingRunning = true; + _isPublishingRunning = true; try { // DO not run publishing if content is re-loading @@ -33,8 +34,6 @@ namespace umbraco.presentation { try { - //d.HttpContext = (HttpContext)sender; - d.ReleaseDate = DateTime.MinValue; //new DateTime(1, 1, 1); // Causes release date to be null d.Publish(d.User); @@ -48,9 +47,7 @@ namespace umbraco.presentation } foreach(Document d in Document.GetDocumentsForExpiration()) { - //d.HttpContext = (HttpContext)sender; - //d.Published = false; - + try { d.ExpireDate = DateTime.MinValue; @@ -78,20 +75,20 @@ namespace umbraco.presentation foreach (XmlNode task in tasks) { bool runTask = false; - if (!scheduledTaskTimes.ContainsKey(task.Attributes.GetNamedItem("alias").Value)) + if (!ScheduledTaskTimes.ContainsKey(task.Attributes.GetNamedItem("alias").Value)) { runTask = true; - scheduledTaskTimes.Add(task.Attributes.GetNamedItem("alias").Value, DateTime.Now); + ScheduledTaskTimes.Add(task.Attributes.GetNamedItem("alias").Value, DateTime.Now); } // Add 1 second to timespan to compensate for differencies in timer else if ( new TimeSpan(DateTime.Now.Ticks - - ((DateTime) scheduledTaskTimes[task.Attributes.GetNamedItem("alias").Value]).Ticks).TotalSeconds + + ((DateTime) ScheduledTaskTimes[task.Attributes.GetNamedItem("alias").Value]).Ticks).TotalSeconds + 1 >= int.Parse(task.Attributes.GetNamedItem("interval").Value)) { runTask = true; - scheduledTaskTimes[task.Attributes.GetNamedItem("alias").Value] = DateTime.Now; + ScheduledTaskTimes[task.Attributes.GetNamedItem("alias").Value] = DateTime.Now; } if (runTask) @@ -115,13 +112,13 @@ namespace umbraco.presentation } finally { - isPublishingRunning = false; + _isPublishingRunning = false; } } private static bool getTaskByHttp(string url) { - HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url); + var myHttpWebRequest = (HttpWebRequest)WebRequest.Create(url); HttpWebResponse myHttpWebResponse = null; try { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/channels/rsd.aspx b/src/Umbraco.Web/umbraco.presentation/umbraco/channels/rsd.aspx deleted file mode 100644 index 20ec1882e8..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/channels/rsd.aspx +++ /dev/null @@ -1,11 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="rsd.aspx.cs" Inherits="umbraco.presentation.umbraco.channels.rsd" %> - - umbraco - http://umbraco.org/ - http://<%=Request.ServerVariables["SERVER_NAME"]%> - - <%=umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco) %>/channels.aspx" /> - <%=umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco) %>/channels.aspx" /> - - - diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/channels/rsd.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/channels/rsd.aspx.cs index 59ab1ad046..7686a48738 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/channels/rsd.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/channels/rsd.aspx.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Data; using System.Configuration; using System.Collections; @@ -11,6 +11,7 @@ using System.Web.UI.HtmlControls; namespace umbraco.presentation.umbraco.channels { + [Obsolete("This class is no longer used and will be removed from the codebase in future versions")] public partial class rsd : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/channels/rsd.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/channels/rsd.aspx.designer.cs deleted file mode 100644 index 857c10d11a..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/channels/rsd.aspx.designer.cs +++ /dev/null @@ -1,15 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.presentation.umbraco.channels { - - - public partial class rsd { - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/channels/wlwmanifest.aspx b/src/Umbraco.Web/umbraco.presentation/umbraco/channels/wlwmanifest.aspx deleted file mode 100644 index c14d5fa55d..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/channels/wlwmanifest.aspx +++ /dev/null @@ -1,28 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="wlwmanifest.aspx.cs" Inherits="umbraco.presentation.channels.wlwmanifest" %> - - http://umbraco.org/images/liveWriterIcon.png - http://umbraco.org/images/liveWriterWatermark.png - View your site/weblog - Edit your site/weblog - {blog-homepage-url}<%= umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco) %>/ - {blog-homepage-url}<%= umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco)%>/actions/editContent.aspx?id={post-id} - - - - WebLayout - - - Yes - Yes - Yes - No - 100 - Yes - Yes - No - No - No - Yes - Yes - - \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/channels/wlwmanifest.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/channels/wlwmanifest.aspx.cs index f71178bceb..51b7b38335 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/channels/wlwmanifest.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/channels/wlwmanifest.aspx.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Data; using System.Configuration; using System.Collections; @@ -11,16 +11,29 @@ using System.Web.UI.HtmlControls; namespace umbraco.presentation.channels { + [Obsolete("This class is no longer used and will be removed from the codebase in future versions")] public partial class wlwmanifest : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { bool useXhtml = false; - if (bool.TryParse(GlobalSettings.EditXhtmlMode, out useXhtml) && !useXhtml) { + if (bool.TryParse(GlobalSettings.EditXhtmlMode, out useXhtml) && !useXhtml) + { xhtml.Text = "no"; - } else { + } + else + { xhtml.Text = "yes"; } } + + /// + /// xhtml control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal xhtml; } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/ping.aspx b/src/Umbraco.Web/umbraco.presentation/umbraco/ping.aspx deleted file mode 100644 index d411738f90..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/ping.aspx +++ /dev/null @@ -1,2 +0,0 @@ -<%@ Page language="c#" Codebehind="ping.aspx.cs" AutoEventWireup="True" Inherits="umbraco.presentation.ping" %> -I'm alive! \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/ping.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/ping.aspx.cs index 63059d804c..71d56511e4 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/ping.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/ping.aspx.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.ComponentModel; using System.Data; @@ -11,32 +11,8 @@ using System.Web.UI.HtmlControls; namespace umbraco.presentation { - /// - /// Summary description for ping. - /// - public partial class ping : System.Web.UI.Page - { - protected void Page_Load(object sender, System.EventArgs e) - { - } - - #region Web Form Designer generated code - override protected void OnInit(EventArgs e) - { - // - // CODEGEN: This call is required by the ASP.NET Web Form Designer. - // - InitializeComponent(); - base.OnInit(e); - } - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - } - #endregion - } + [Obsolete("This class is no longer used and will be removed in future versions")] + public partial class ping : System.Web.UI.Page + { + } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/ping.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/ping.aspx.designer.cs deleted file mode 100644 index 7154280a25..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/ping.aspx.designer.cs +++ /dev/null @@ -1,15 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.42 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.presentation { - - public partial class ping { - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/plugins/tinymce3/insertChar.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/plugins/tinymce3/insertChar.aspx.cs index 1ffdf75020..478c1bdea7 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/plugins/tinymce3/insertChar.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/plugins/tinymce3/insertChar.aspx.cs @@ -6,7 +6,7 @@ using System.Web.UI.WebControls; namespace umbraco.presentation.umbraco.plugins.tinymce3 { - public partial class insertChar : System.Web.UI.Page + public partial class insertChar : BasePages.UmbracoEnsuredPage { protected override void OnLoad(EventArgs e) { diff --git a/src/umbraco.businesslogic/BasePages/BasePage.cs b/src/umbraco.businesslogic/BasePages/BasePage.cs index cc4148a0da..d8c6bff73f 100644 --- a/src/umbraco.businesslogic/BasePages/BasePage.cs +++ b/src/umbraco.businesslogic/BasePages/BasePage.cs @@ -5,10 +5,10 @@ using System.Linq; using System.Web.Mvc; using System.Web.Routing; using System.Web.Security; +using Umbraco.Core.IO; using Umbraco.Core.Logging; using umbraco.BusinessLogic; using umbraco.DataLayer; -using umbraco.IO; using System.Web.UI; namespace umbraco.BasePages diff --git a/src/umbraco.cms/helpers/url.cs b/src/umbraco.cms/helpers/url.cs index 3fdc380785..7980527fcc 100644 --- a/src/umbraco.cms/helpers/url.cs +++ b/src/umbraco.cms/helpers/url.cs @@ -1,7 +1,8 @@ using System; using System.Xml; using System.Text.RegularExpressions; -using umbraco.IO; +using Umbraco.Core; +using Umbraco.Core.IO; namespace umbraco.cms.helpers { @@ -44,12 +45,17 @@ namespace umbraco.cms.helpers /// True if it's an allowed url public static bool ValidateProxyUrl(string url, string callerUrl) { + if (!Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute)) + { + return false; + } + Uri requestUri; - Uri localUri; if (Uri.TryCreate(url, UriKind.RelativeOrAbsolute, out requestUri)) { - if (!String.IsNullOrEmpty(callerUrl)) + if (!string.IsNullOrEmpty(callerUrl)) { + Uri localUri; if (Uri.TryCreate(callerUrl, UriKind.RelativeOrAbsolute, out localUri)) { // check for local urls @@ -60,18 +66,21 @@ namespace umbraco.cms.helpers } else { + //TODO: SD: why throw an exception?? shouldn't we just return false ? throw new ArgumentException("CallerUrl is in a wrong format that couldn't be parsed as a valid URI. If you don't want to evaluate for local urls, but just proxy urls then leave callerUrl empty", "callerUrl"); } } // check for valid proxy urls - var feedProxyXml = xmlHelper.OpenAsXmlDocument(IOHelper.MapPath(SystemFiles.FeedProxyConfig)); + var feedProxyXml = XmlHelper.OpenAsXmlDocument(IOHelper.MapPath(SystemFiles.FeedProxyConfig)); if (feedProxyXml != null && feedProxyXml.SelectSingleNode(string.Concat("//allow[@host = '", requestUri.Host, "']")) != null) { return true; } - } else + } + else { + //TODO: SD: why throw an exception?? shouldn't we just return false ? throw new ArgumentException("url is in a wrong format that couldn't be parsed as a valid URI", "url"); }