From 48c635e452870b54c9cbbd48bebfcf26d5beaf9f Mon Sep 17 00:00:00 2001 From: DougM Date: Wed, 26 Jan 2011 20:38:01 +0000 Subject: [PATCH] fix #29904 - Rich text editor 'insert link' breaks when selecting node with single quote in name (incorreclty marked as fixed in work item) --- umbraco/presentation/umbraco/Trees/BaseContentTree.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/umbraco/presentation/umbraco/Trees/BaseContentTree.cs b/umbraco/presentation/umbraco/Trees/BaseContentTree.cs index 0f5d156afa..f343f4adbe 100644 --- a/umbraco/presentation/umbraco/Trees/BaseContentTree.cs +++ b/umbraco/presentation/umbraco/Trees/BaseContentTree.cs @@ -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) {