Properly URL Encodes stylesheet properties

This commit is contained in:
Sebastiaan Janssen
2016-06-24 10:49:07 +02:00
parent 7dcd67f953
commit 2e2d0e506f
2 changed files with 3 additions and 3 deletions

View File

@@ -58,12 +58,12 @@ namespace umbraco
{
var sheetId = sheet.Path.TrimEnd(".css");
var xNode = XmlTreeNode.Create(this);
xNode.NodeID = sheetId + "_" + prop.Name;
xNode.NodeID = sheetId + "_" + HttpUtility.UrlEncode(prop.Name);
xNode.Text = prop.Name;
xNode.Action = "javascript:openStylesheetProperty('" +
//Needs to be escaped for JS
HttpUtility.UrlEncode(sheet.Path) +
"','" + prop.Name + "');";
"','" + HttpUtility.UrlEncode(prop.Name) + "');";
xNode.Icon = "icon-brackets";
xNode.OpenIcon = "icon-brackets";

View File

@@ -26,7 +26,7 @@ namespace umbraco
s.AddProperty(new StylesheetProperty(Alias, "." + Alias.ToSafeAlias(), ""));
Umbraco.Core.ApplicationContext.Current.Services.FileService.SaveStylesheet(s);
_returnUrl = string.Format("settings/stylesheet/property/EditStyleSheetProperty.aspx?id={0}&prop={1}", HttpUtility.UrlEncode(s.Path), Alias);
_returnUrl = string.Format("settings/stylesheet/property/EditStyleSheetProperty.aspx?id={0}&prop={1}", HttpUtility.UrlEncode(s.Path), HttpUtility.UrlEncode(Alias));
return true;
}