From 4a8a09c78aa20f08c7ae94a8af2c7fbaa73d83ee Mon Sep 17 00:00:00 2001 From: markvantilburg Date: Mon, 13 Jan 2014 11:33:24 +0100 Subject: [PATCH 1/2] Update booting.aspx Throw the exception immediately if the parameter is not there or empty. If the parameter is not there it's defaulted to the current url, and this will redirect to itself and create an endless loop here. --- src/Umbraco.Web.UI/config/splashes/booting.aspx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI/config/splashes/booting.aspx b/src/Umbraco.Web.UI/config/splashes/booting.aspx index 267e36b369..1bea61f89d 100644 --- a/src/Umbraco.Web.UI/config/splashes/booting.aspx +++ b/src/Umbraco.Web.UI/config/splashes/booting.aspx @@ -2,7 +2,7 @@ <% // NH: Adds this inline check to avoid a simple codebehind file in the legacy project! - if (!umbraco.cms.helpers.url.ValidateProxyUrl(Request["url"], Request.Url.AbsoluteUri)) + if (Request["url"].ToLower().Contains("booting.aspx") || !umbraco.cms.helpers.url.ValidateProxyUrl(Request["url"], Request.Url.AbsoluteUri)) { throw new ArgumentException("Can't redirect to the requested url - it's not local or an approved proxy url", "url"); From 06ae6ad15e5185ea1c556a8ce7eb225cd2495c06 Mon Sep 17 00:00:00 2001 From: Richard Soeteman Date: Mon, 27 Jan 2014 10:15:14 +0100 Subject: [PATCH 2/2] Fix media.save throws an error in Umbraco 7.0.x See http://issues.umbraco.org/issue/U4-3928 width and Height properties are assigned on the file media types. This was because of always assigning a value to content.getProperty(uploadFieldConfigNode.WidthFieldAlias).Value Added an if statement to make sure the media item is an image when assigning those values. --- .../DataTypes/LegacyUploadFieldWorkaround.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web/Strategies/DataTypes/LegacyUploadFieldWorkaround.cs b/src/Umbraco.Web/Strategies/DataTypes/LegacyUploadFieldWorkaround.cs index 20ba39dccc..f7168b7e66 100644 --- a/src/Umbraco.Web/Strategies/DataTypes/LegacyUploadFieldWorkaround.cs +++ b/src/Umbraco.Web/Strategies/DataTypes/LegacyUploadFieldWorkaround.cs @@ -81,10 +81,15 @@ namespace Umbraco.Web.Strategies.DataTypes var dimensions = isImageType ? GetDimensions(path, fileSystem) : null; - // only add dimensions to web images - content.getProperty(uploadFieldConfigNode.WidthFieldAlias).Value = isImageType ? dimensions.Item1.ToString(CultureInfo.InvariantCulture) : string.Empty; - content.getProperty(uploadFieldConfigNode.HeightFieldAlias).Value = isImageType ? dimensions.Item2.ToString(CultureInfo.InvariantCulture) : string.Empty; - content.getProperty(uploadFieldConfigNode.LengthFieldAlias).Value = size == default(long) ? string.Empty : size.ToString(CultureInfo.InvariantCulture); + + if (isImageType) + { + // only add dimensions to web images + content.getProperty(uploadFieldConfigNode.WidthFieldAlias).Value = dimensions.Item1.ToString(CultureInfo.InvariantCulture); + content.getProperty(uploadFieldConfigNode.HeightFieldAlias).Value = dimensions.Item2.ToString(CultureInfo.InvariantCulture); + } + + content.getProperty(uploadFieldConfigNode.LengthFieldAlias).Value = size == default(long) ? string.Empty : size.ToString(CultureInfo.InvariantCulture); content.getProperty(uploadFieldConfigNode.ExtensionFieldAlias).Value = string.IsNullOrEmpty(extension) ? string.Empty : extension; }