Merge with 6.0.1
This commit is contained in:
@@ -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));
|
||||
|
||||
|
||||
1
src/Umbraco.Tests/Masterpages/dummy.txt
Normal file
1
src/Umbraco.Tests/Masterpages/dummy.txt
Normal file
@@ -0,0 +1 @@
|
||||
This file is just here to make sure the directory gets created.
|
||||
1
src/Umbraco.Tests/Views/dummy.txt
Normal file
1
src/Umbraco.Tests/Views/dummy.txt
Normal file
@@ -0,0 +1 @@
|
||||
This file is just here to make sure the directory gets created.
|
||||
@@ -1,8 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="ClientDependency" version="1.5.1.0" targetFramework="net40" />
|
||||
<package id="Examine" version="0.1.47.2941" targetFramework="net40" />
|
||||
<package id="ClientDependency-Mvc" version="1.5.1.0" targetFramework="net40" />
|
||||
<package id="log4net-mediumtrust" version="2.0.0" targetFramework="net40" />
|
||||
<package id="Lucene.Net" version="2.9.4.1" targetFramework="net40" />
|
||||
<package id="Microsoft.AspNet.Mvc" version="4.0.20710.0" targetFramework="net40" />
|
||||
<package id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="1.0.1" targetFramework="net40" />
|
||||
<package id="Microsoft.AspNet.Razor" version="2.0.20715.0" targetFramework="net40" />
|
||||
@@ -10,6 +12,7 @@
|
||||
<package id="Microsoft.Web.Helpers" version="1.0.0" targetFramework="net40" />
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net40" />
|
||||
<package id="MySql.Data" version="6.6.4" targetFramework="net40" />
|
||||
<package id="SharpZipLib" version="0.86.0" targetFramework="net40" />
|
||||
<package id="SqlServerCE" version="4.0.0.0" targetFramework="net40" />
|
||||
<package id="uGoLive" version="1.4.0" targetFramework="net40" />
|
||||
<package id="UrlRewritingNet.UrlRewriter" version="2.0.60829.1" targetFramework="net40" />
|
||||
|
||||
@@ -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 = @"<img [^>]*>";
|
||||
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<MediaFileSystem>();
|
||||
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 + "\"";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user