diff --git a/src/Umbraco.Core/Models/PropertyExtensions.cs b/src/Umbraco.Core/Models/PropertyExtensions.cs index c4568e8472..1b851d8d4b 100644 --- a/src/Umbraco.Core/Models/PropertyExtensions.cs +++ b/src/Umbraco.Core/Models/PropertyExtensions.cs @@ -19,6 +19,14 @@ namespace Umbraco.Core.Models var xd = new XmlDocument(); XmlNode xmlNode = xd.CreateNode(XmlNodeType.Element, nodeName, ""); + //Add the property alias to the legacy schema + if (UmbracoSettings.UseLegacyXmlSchema) + { + var alias = xd.CreateAttribute("alias"); + alias.Value = property.Alias.ToSafeAlias(); + xmlNode.Attributes.Append(alias); + } + //This seems to fail during testing xmlNode.AppendChild(property.PropertyType.DataType(property.Id).Data.ToXMl(xd)); diff --git a/src/Umbraco.Tests/Masterpages/dummy.txt b/src/Umbraco.Tests/Masterpages/dummy.txt new file mode 100644 index 0000000000..9c01dce8f4 --- /dev/null +++ b/src/Umbraco.Tests/Masterpages/dummy.txt @@ -0,0 +1 @@ +This file is just here to make sure the directory gets created. \ No newline at end of file diff --git a/src/Umbraco.Tests/Views/dummy.txt b/src/Umbraco.Tests/Views/dummy.txt new file mode 100644 index 0000000000..9c01dce8f4 --- /dev/null +++ b/src/Umbraco.Tests/Views/dummy.txt @@ -0,0 +1 @@ +This file is just here to make sure the directory gets created. \ No newline at end of file diff --git a/src/Umbraco.Web.UI/packages.config b/src/Umbraco.Web.UI/packages.config index be4beafea8..b929b40d4c 100644 --- a/src/Umbraco.Web.UI/packages.config +++ b/src/Umbraco.Web.UI/packages.config @@ -1,8 +1,10 @@  + + @@ -10,6 +12,7 @@ + diff --git a/src/umbraco.editorControls/tinymce/tinyMCEImageHelper.cs b/src/umbraco.editorControls/tinymce/tinyMCEImageHelper.cs index 6072ec936f..ac8bb63ee3 100644 --- a/src/umbraco.editorControls/tinymce/tinyMCEImageHelper.cs +++ b/src/umbraco.editorControls/tinymce/tinyMCEImageHelper.cs @@ -1,5 +1,6 @@ using System; using System.Collections; +using System.Linq; using System.Text.RegularExpressions; using System.Web; using Umbraco.Core.IO; @@ -14,7 +15,12 @@ namespace umbraco.editorControls.tinymce { public static string cleanImages(string html) { - var allowedAttributes = UmbracoSettings.ImageAllowedAttributes.ToLower().Split(','); + var allowedAttributes = UmbracoSettings.ImageAllowedAttributes.ToLower().Split(',').ToList(); + + //Always add src as it's essential to output any image at all + if (allowedAttributes.Contains("src") == false) + allowedAttributes.Add("src"); + const string pattern = @"]*>"; var tags = Regex.Matches(html + " ", pattern, RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); foreach (Match tag in tags) @@ -43,7 +49,11 @@ namespace umbraco.editorControls.tinymce { int newWidth; int newHeight; - cleanTag += DoResize(ht, out newWidth, out newHeight); + string newSrc; + + cleanTag += DoResize(ht, out newWidth, out newHeight, out newSrc); + + ht["src"] = newSrc; } catch (Exception err) { @@ -96,7 +106,7 @@ namespace umbraco.editorControls.tinymce return html; } - private static string DoResize(IDictionary attributes, out int finalWidth, out int finalHeight) + private static string DoResize(IDictionary attributes, out int finalWidth, out int finalHeight, out string newSrc) { var fs = FileSystemProviderManager.Current.GetFileSystemProvider(); var orgSrc = HttpContext.Current.Server.HtmlDecode(helper.FindAttribute(attributes, "src").Replace("%20", " ")); @@ -106,7 +116,7 @@ namespace umbraco.editorControls.tinymce var newWidth = int.Parse(helper.FindAttribute(attributes, "width")); var newHeight = int.Parse(helper.FindAttribute(attributes, "height")); - var newSrc = ""; + newSrc = ""; if (orgHeight > 0 && orgWidth > 0 && orgSrc != "") { @@ -126,12 +136,12 @@ namespace umbraco.editorControls.tinymce var uf = new UmbracoFile(orgPath); newSrc = uf.Resize(newWidth, newHeight); } - } + } finalWidth = newWidth; finalHeight = newHeight; - return " src=\"" + newSrc + "\" width=\"" + newWidth + "\" height=\"" + newHeight + "\""; + return " width=\"" + newWidth + "\" height=\"" + newHeight + "\""; } } } \ No newline at end of file