Compare commits

...

6 Commits

11 changed files with 73 additions and 96 deletions
+1 -1
View File
@@ -17,7 +17,7 @@
<dependencies>
<dependency id="Microsoft.AspNet.Mvc" version="[4.0.30506.0,5.0.0)" />
<dependency id="Microsoft.AspNet.WebApi" version="[4.0.30506,5.0.0)" />
<dependency id="Microsoft.AspNet.WebApi.Host" version="[4.0.30506, 5.0.0)" />
<dependency id="Microsoft.AspNet.WebApi.WebHost" version="[4.0.30506, 5.0.0)" />
<dependency id="Microsoft.AspNet.WebApi.Core" version="[4.0.30506, 5.0.0)" />
<dependency id="Microsoft.AspNet.WebApi.Client" version="[4.0.30506, 5.0.0)" />
<dependency id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="1.0.1" />
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<UmbracoVersion>6.2.1</UmbracoVersion>
<UmbracoVersion>6.2.2</UmbracoVersion>
</PropertyGroup>
<Target Name="CopyUmbracoFilesToWebRoot" BeforeTargets="AfterBuild">
<PropertyGroup>
+17 -9
View File
@@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
@@ -27,6 +28,11 @@ namespace Umbraco.Core.Models
public static class DeepCloneHelper
{
/// <summary>
/// Used to avoid constant reflection (perf)
/// </summary>
private static readonly ConcurrentDictionary<Type, PropertyInfo[]> PropCache = new ConcurrentDictionary<Type, PropertyInfo[]>();
/// <summary>
/// Used to deep clone any reference properties on the object (should be done after a MemberwiseClone for which the outcome is 'output')
/// </summary>
@@ -43,16 +49,18 @@ namespace Umbraco.Core.Models
throw new InvalidOperationException("Both the input and output types must be the same");
}
var refProperties = inputType.GetProperties()
.Where(x =>
//is not attributed with the ignore clone attribute
var refProperties = PropCache.GetOrAdd(inputType, type =>
inputType.GetProperties()
.Where(x =>
//is not attributed with the ignore clone attribute
Attribute.GetCustomAttribute(x, typeof(DoNotCloneAttribute)) == null
//reference type but not string
&& x.PropertyType.IsValueType == false && x.PropertyType != typeof (string)
//settable
&& x.CanWrite
//non-indexed
&& x.GetIndexParameters().Any() == false);
//reference type but not string
&& x.PropertyType.IsValueType == false && x.PropertyType != typeof (string)
//settable
&& x.CanWrite
//non-indexed
&& x.GetIndexParameters().Any() == false)
.ToArray());
foreach (var propertyInfo in refProperties)
{
+1 -2
View File
@@ -1611,7 +1611,6 @@
<Content Include="Umbraco\Dashboard\Images\starterkit32x32.png" />
<Content Include="Umbraco\Dashboard\Images\TV.png" />
<Content Include="Umbraco\Dashboard\Images\ZipFile.png" />
<Content Include="Umbraco\Dashboard\Swfs\AIRInstallBadge.swf" />
<Content Include="Umbraco\Dashboard\Swfs\expressinstall.swf" />
<Content Include="Umbraco\Images\Editor\insMacroSB.png" />
<Content Include="Umbraco\Images\Editor\insRazorMacro.png" />
@@ -2676,7 +2675,7 @@ xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.0\x86\*.* "$(TargetDir)x86\"
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>6210</DevelopmentServerPort>
<DevelopmentServerPort>6220</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:6220</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
@@ -1,50 +1,25 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DesktopMediaUploader.ascx.cs" Inherits="umbraco.presentation.umbraco.dashboard.DesktopMediaUploader" %>
<%@ Register Assembly="controls" Namespace="umbraco.uicontrols" TagPrefix="umb" %>
<%@ Register Assembly="ClientDependency.Core" Namespace="ClientDependency.Core.Controls" TagPrefix="umb" %>
<umb:CssInclude runat="server" FilePath="propertypane/style.css" PathNameAlias="UmbracoClient" />
<umb:JsInclude runat="server" FilePath="dashboard/scripts/swfobject.js" PathNameAlias="UmbracoRoot" />
<div class="dashboardWrapper">
<h2>Desktop Media Uploader</h2>
<img src="./dashboard/images/dmu.png" alt="Umbraco" class="dashboardIcon" />
<p><strong>Desktop Media Uploader</strong> is a small desktop application that you can install on your computer which allows you to easily upload media items directly to the media section.</p>
<p>The badge below will auto configure itself based upon whether you already have <strong>Desktop Media Uploader</strong> installed or not.</p>
<p>Just click the <strong>Install Now / Upgrade Now / Launch Now</strong> link to perform that action.</p>
<div class="dashboardColWrapper">
<div class="dashboardCols">
<div class="dashboardCol">
<asp:Panel ID="Panel1" runat="server"></asp:Panel>
<asp:Panel ID="Panel2" runat="server">
<p>
<div id="dmu-badge">
Download <a href="<%= FullyQualifiedAppPath %>umbraco/dashboard/air/desktopmediauploader.air">Desktop Media Uploader</a> now.<br /><br /><span id="Span1">This application requires Adobe&#174;&nbsp;AIR&#8482; to be installed for <a href="http://airdownload.adobe.com/air/mac/download/latest/AdobeAIR.dmg">Mac OS</a> or <a href="http://airdownload.adobe.com/air/win/download/latest/AdobeAIRInstaller.exe">Windows</a>.
</div>
</p>
<script type="text/javascript">
// <![CDATA[
var flashvars = {
appid: "org.umbraco.DesktopMediaUploader",
appname: "Desktop Media Uploader",
appversion: "v2.1.0",
appurl: "<%= FullyQualifiedAppPath %>umbraco/dashboard/air/desktopmediauploader.air",
applauncharg: "<%= AppLaunchArg %>",
image: "/umbraco/dashboard/images/dmu-badge.jpg?2.1.0",
airversion: "2.0"
};
var params = {
menu: "false",
wmode: "opaque"
};
var attributes = {
style: "margin-bottom:10px;"
};
swfobject.embedSWF("/umbraco/dashboard/swfs/airinstallbadge.swf", "dmu-badge", "215", "180", "9.0.115", "/umbraco/dashboard/swfs/expressinstall.swf", flashvars, params, attributes);
// ]]>
</script>
<div id="dmu-badge">
<p>
<span id="Span1">This application requires Adobe&#174;&nbsp;AIR&#8482; to be installed for <a href="http://airdownload.adobe.com/air/mac/download/latest/AdobeAIR.dmg">Mac OS</a> or <a href="http://airdownload.adobe.com/air/win/download/latest/AdobeAIRInstaller.exe">Windows</a></span>.<br />
After Air is installed you can install the <a href="<%= FullyQualifiedAppPath %>umbraco/Dashboard/air/DesktopMediaUploader.air">Desktop Media Uploader by clicking here</a>.
</p>
</div>
</asp:Panel>
</div>
</div>
</div>
</div>
</div>
+3 -1
View File
@@ -1795,7 +1795,9 @@
<Content Include="umbraco.presentation\umbraco\developer\RelationTypes\EditRelationType.aspx" />
<Content Include="umbraco.presentation\umbraco\developer\RelationTypes\NewRelationType.aspx" />
<Content Include="umbraco.presentation\umbraco\developer\RelationTypes\RelationTypesWebService.asmx" />
<Content Include="umbraco.presentation\umbraco\dashboard\DesktopMediaUploader.ascx" />
<Content Include="umbraco.presentation\umbraco\dashboard\DesktopMediaUploader.ascx">
<SubType>ASPXCodeBehind</SubType>
</Content>
<Content Include="umbraco.presentation\umbraco\dashboard\DeveloperDashboardIntro.ascx" />
<Content Include="umbraco.presentation\umbraco\dashboard\DeveloperDashboardVideos.ascx" />
<Content Include="umbraco.presentation\umbraco\dashboard\FeedProxy.aspx" />
+1
View File
@@ -46,6 +46,7 @@ namespace Umbraco.Web
{
// the keepalive service will use that url
ApplicationContext.Current.OriginalRequestUrl = string.Format("{0}:{1}{2}", httpContext.Request.ServerVariables["SERVER_NAME"], httpContext.Request.ServerVariables["SERVER_PORT"], IOHelper.ResolveUrl(SystemDirectories.Umbraco));
LogHelper.Info<UmbracoModule>("Setting OriginalRequestUrl: " + ApplicationContext.Current.OriginalRequestUrl);
}
// do not process if client-side request
+21 -17
View File
@@ -20,6 +20,7 @@ using umbraco.cms.businesslogic.cache;
using umbraco.cms.businesslogic.web;
using umbraco.DataLayer;
using umbraco.presentation.nodeFactory;
using Umbraco.Web;
using Action = umbraco.BusinessLogic.Actions.Action;
using Node = umbraco.NodeFactory.Node;
using Umbraco.Core;
@@ -96,13 +97,13 @@ namespace umbraco
{
get
{
if (HttpContext.Current == null)
if (UmbracoContext.Current == null || UmbracoContext.Current.HttpContext == null)
return XmlContentInternal;
var content = HttpContext.Current.Items[XmlContextContentItemKey] as XmlDocument;
var content = UmbracoContext.Current.HttpContext.Items[XmlContextContentItemKey] as XmlDocument;
if (content == null)
{
content = XmlContentInternal;
HttpContext.Current.Items[XmlContextContentItemKey] = content;
UmbracoContext.Current.HttpContext.Items[XmlContextContentItemKey] = content;
}
return content;
}
@@ -827,24 +828,27 @@ namespace umbraco
/// </summary>
internal void RemoveXmlFilePersistenceQueue()
{
HttpContext.Current.Application.Lock();
HttpContext.Current.Application[PersistenceFlagContextKey] = null;
HttpContext.Current.Application.UnLock();
if (UmbracoContext.Current != null && UmbracoContext.Current.HttpContext != null)
{
UmbracoContext.Current.HttpContext.Application.Lock();
UmbracoContext.Current.HttpContext.Application[PersistenceFlagContextKey] = null;
UmbracoContext.Current.HttpContext.Application.UnLock();
}
}
internal bool IsXmlQueuedForPersistenceToFile
{
get
{
if (HttpContext.Current != null)
if (UmbracoContext.Current != null && UmbracoContext.Current.HttpContext != null)
{
bool val = HttpContext.Current.Application[PersistenceFlagContextKey] != null;
bool val = UmbracoContext.Current.HttpContext.Application[PersistenceFlagContextKey] != null;
if (val)
{
DateTime persistenceTime = DateTime.MinValue;
try
{
persistenceTime = (DateTime)HttpContext.Current.Application[PersistenceFlagContextKey];
persistenceTime = (DateTime)UmbracoContext.Current.HttpContext.Application[PersistenceFlagContextKey];
if (persistenceTime > GetCacheFileUpdateTime())
{
return true;
@@ -893,8 +897,8 @@ namespace umbraco
private void ClearContextCache()
{
// If running in a context very important to reset context cache orelse new nodes are missing
if (HttpContext.Current != null && HttpContext.Current.Items.Contains(XmlContextContentItemKey))
HttpContext.Current.Items.Remove(XmlContextContentItemKey);
if (UmbracoContext.Current != null && UmbracoContext.Current.HttpContext != null && UmbracoContext.Current.HttpContext.Items.Contains(XmlContextContentItemKey))
UmbracoContext.Current.HttpContext.Items.Remove(XmlContextContentItemKey);
}
/// <summary>
@@ -1192,20 +1196,20 @@ order by umbracoNode.level, umbracoNode.sortOrder";
{
//if this is called outside a web request we cannot queue it it will run in the current thread.
if (HttpContext.Current != null)
if (UmbracoContext.Current != null && UmbracoContext.Current.HttpContext != null)
{
HttpContext.Current.Application.Lock();
UmbracoContext.Current.HttpContext.Application.Lock();
try
{
if (HttpContext.Current.Application[PersistenceFlagContextKey] != null)
if (UmbracoContext.Current.HttpContext.Application[PersistenceFlagContextKey] != null)
{
HttpContext.Current.Application.Add(PersistenceFlagContextKey, null);
UmbracoContext.Current.HttpContext.Application.Add(PersistenceFlagContextKey, null);
}
HttpContext.Current.Application[PersistenceFlagContextKey] = DateTime.UtcNow;
UmbracoContext.Current.HttpContext.Application[PersistenceFlagContextKey] = DateTime.UtcNow;
}
finally
{
HttpContext.Current.Application.UnLock();
UmbracoContext.Current.HttpContext.Application.UnLock();
}
}
else
@@ -1,50 +1,25 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DesktopMediaUploader.ascx.cs" Inherits="umbraco.presentation.umbraco.dashboard.DesktopMediaUploader" %>
<%@ Register Assembly="controls" Namespace="umbraco.uicontrols" TagPrefix="umb" %>
<%@ Register Assembly="ClientDependency.Core" Namespace="ClientDependency.Core.Controls" TagPrefix="umb" %>
<umb:CssInclude runat="server" FilePath="propertypane/style.css" PathNameAlias="UmbracoClient" />
<umb:JsInclude runat="server" FilePath="dashboard/scripts/swfobject.js" PathNameAlias="UmbracoRoot" />
<div class="dashboardWrapper">
<h2>Desktop Media Uploader</h2>
<img src="./dashboard/images/dmu.png" alt="Umbraco" class="dashboardIcon" />
<p><strong>Desktop Media Uploader</strong> is a small desktop application that you can install on your computer which allows you to easily upload media items directly to the media section.</p>
<p>The badge below will auto configure itself based upon whether you already have <strong>Desktop Media Uploader</strong> installed or not.</p>
<p>Just click the <strong>Install Now / Upgrade Now / Launch Now</strong> link to perform that action.</p>
<div class="dashboardColWrapper">
<div class="dashboardCols">
<div class="dashboardCol">
<asp:Panel ID="Panel1" runat="server"></asp:Panel>
<asp:Panel ID="Panel2" runat="server">
<p>
<div id="dmu-badge">
Download <a href="<%= FullyQualifiedAppPath %>umbraco/dashboard/air/desktopmediauploader.air">Desktop Media Uploader</a> now.<br /><br /><span id="Span1">This application requires Adobe&#174;&nbsp;AIR&#8482; to be installed for <a href="http://airdownload.adobe.com/air/mac/download/latest/AdobeAIR.dmg">Mac OS</a> or <a href="http://airdownload.adobe.com/air/win/download/latest/AdobeAIRInstaller.exe">Windows</a>.
</div>
</p>
<script type="text/javascript">
// <![CDATA[
var flashvars = {
appid: "org.umbraco.DesktopMediaUploader",
appname: "Desktop Media Uploader",
appversion: "v2.1.0",
appurl: "<%= FullyQualifiedAppPath %>umbraco/dashboard/air/desktopmediauploader.air",
applauncharg: "<%= AppLaunchArg %>",
image: "/umbraco/dashboard/images/dmu-badge.jpg?2.1.0",
airversion: "2.0"
};
var params = {
menu: "false",
wmode: "opaque"
};
var attributes = {
style: "margin-bottom:10px;"
};
swfobject.embedSWF("/umbraco/dashboard/swfs/airinstallbadge.swf", "dmu-badge", "215", "180", "9.0.115", "/umbraco/dashboard/swfs/expressinstall.swf", flashvars, params, attributes);
// ]]>
</script>
<div id="dmu-badge">
<p>
<span id="Span1">This application requires Adobe&#174;&nbsp;AIR&#8482; to be installed for <a href="http://airdownload.adobe.com/air/mac/download/latest/AdobeAIR.dmg">Mac OS</a> or <a href="http://airdownload.adobe.com/air/win/download/latest/AdobeAIRInstaller.exe">Windows</a></span>.<br />
After Air is installed you can install the <a href="<%= FullyQualifiedAppPath %>umbraco/Dashboard/air/DesktopMediaUploader.air">Desktop Media Uploader by clicking here</a>.
</p>
</div>
</asp:Panel>
</div>
</div>
</div>
</div>
</div>
+14 -1
View File
@@ -47,7 +47,13 @@ namespace umbraco.cms.helpers
if (Uri.TryCreate(callerUrl, UriKind.RelativeOrAbsolute, out localUri))
{
// check for local urls
if (!requestUri.IsAbsoluteUri || requestUri.Host == localUri.Host)
//Cannot start with // since that is not a local url
if (!requestUri.OriginalString.StartsWith("//")
//cannot be non-absolute and also contain the char : since that will indicate a protocol
&& (!requestUri.IsAbsoluteUri && !requestUri.OriginalString.Contains(":"))
//needs to be non-absolute or the hosts must match the current request
&& (!requestUri.IsAbsoluteUri || requestUri.Host == localUri.Host))
{
return true;
}
@@ -58,6 +64,13 @@ namespace umbraco.cms.helpers
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");
}
}
//we cannot continue if the url is not absolute
if (!requestUri.IsAbsoluteUri)
{
return false;
}
// check for valid proxy urls
var feedProxyXml = XmlHelper.OpenAsXmlDocument(IOHelper.MapPath(SystemFiles.FeedProxyConfig));
if (feedProxyXml != null &&