fix #29904 - Rich text editor 'insert link' breaks when selecting node with single quote in name (incorreclty marked as fixed in work item)

This commit is contained in:
DougM
2011-01-26 20:38:01 +00:00
parent 1c02059509
commit 48c635e452

View File

@@ -216,15 +216,16 @@ function openContent(id) {
else if (this.DialogMode == TreeDialogModes.locallink)
{
string nodeLink = string.Format("{{localLink:{0}}}", dd.Id);
string nodeText = dd.Text.Replace("'", "\\'");
// try to make a niceurl too
string niceUrl = umbraco.library.NiceUrl(dd.Id);
string niceUrl = umbraco.library.NiceUrl(dd.Id).Replace("'", "\\'"); ;
if (niceUrl != "#" || niceUrl != "") {
nodeLink += "|" + niceUrl + "|" + HttpContext.Current.Server.HtmlEncode(dd.Text);
nodeLink += "|" + niceUrl + "|" + HttpContext.Current.Server.HtmlEncode(nodeText);
} else {
nodeLink += "||" + HttpContext.Current.Server.HtmlEncode(dd.Text);
nodeLink += "||" + HttpContext.Current.Server.HtmlEncode(nodeText);
}
treeElement.Action = String.Format("javascript:openContent('{0}');", nodeLink.Replace("'","\\'"));
treeElement.Action = String.Format("javascript:openContent('{0}');", nodeLink);
}
else if (this.DialogMode == TreeDialogModes.id || this.DialogMode == TreeDialogModes.none)
{