| 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 ca819e02ed..8b4ccce8e9 100644
--- a/src/Umbraco.Web/LegacyScheduledTasks.cs
+++ b/src/Umbraco.Web/LegacyScheduledTasks.cs
@@ -34,10 +34,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 4b789ec9a6..1672a78861 100644
--- a/src/Umbraco.Web/Umbraco.Web.csproj
+++ b/src/Umbraco.Web/Umbraco.Web.csproj
@@ -471,8 +471,14 @@
+ ASPXCodeBehind
+
+
ASPXCodeBehind
+
+ ASPXCodeBehind
+
ASPXCodeBehind
@@ -720,21 +726,7 @@
-
- ASPXCodeBehind
- rsd.aspx
-
-
- rsd.aspx
-
-
- ASPXCodeBehind
- wlwmanifest.aspx
-
-
- wlwmanifest.aspx
-
@@ -1844,8 +1836,6 @@
-
-
@@ -1973,7 +1963,9 @@
ASPXCodeBehind
-
+
+ ASPXCodeBehind
+
ASPXCodeBehind
diff --git a/src/Umbraco.Web/UmbracoModule.cs b/src/Umbraco.Web/UmbracoModule.cs
index 36adfdcb29..e2b136f535 100644
--- a/src/Umbraco.Web/UmbracoModule.cs
+++ b/src/Umbraco.Web/UmbracoModule.cs
@@ -4,10 +4,10 @@ using System.Linq;
using System.Web;
using System.Web.Routing;
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;
using Umbraco.Web.Configuration;
@@ -30,6 +30,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/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 cf537da504..d22165d648 100644
--- a/src/Umbraco.Web/umbraco.presentation/publishingService.cs
+++ b/src/Umbraco.Web/umbraco.presentation/publishingService.cs
@@ -18,6 +18,7 @@ namespace umbraco.presentation
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)
@@ -112,7 +113,7 @@ namespace umbraco.presentation
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.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/ping.aspx.cs
index 56a2d66646..758c602942 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/ping.aspx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/ping.aspx.cs
@@ -11,16 +11,10 @@ using System.Web.UI.HtmlControls;
namespace umbraco.presentation
{
- ///
- /// Summary description for ping.
- ///
+
[Obsolete("This class is no longer used and will be removed in future versions.")]
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)
{
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 81076120d6..ad7d73ddb8 100644
--- a/src/umbraco.businesslogic/BasePages/BasePage.cs
+++ b/src/umbraco.businesslogic/BasePages/BasePage.cs
@@ -6,12 +6,12 @@ using System.Web.Mvc;
using System.Web.Routing;
using System.Web.Security;
using Umbraco.Core;
+using Umbraco.Core.IO;
using Umbraco.Core.Cache;
using Umbraco.Core.Logging;
using Umbraco.Core.Services;
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 1bd2efd682..e32b0333f4 100644
--- a/src/umbraco.cms/helpers/url.cs
+++ b/src/umbraco.cms/helpers/url.cs
@@ -1,8 +1,8 @@
using System;
using System.Xml;
using System.Text.RegularExpressions;
-using umbraco.IO;
using Umbraco.Core;
+using Umbraco.Core.IO;
using Umbraco.Core.CodeAnnotations;
namespace umbraco.cms.helpers
@@ -33,12 +33,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
@@ -49,18 +54,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");
}
|
|---|