Skip to content
This repository was archived by the owner on Oct 14, 2024. It is now read-only.

Fixed issue #568 #570

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AjaxControlToolkit/HtmlEditorExtender/HtmlEditorExtender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ public string Decode(string value) {
var hrefCharacters = "^\\\"\\>\\<\\\\";
result = Regex.Replace(result, "(?:\\&lt\\;|\\<)(\\/?)(a(?:(?:\\shref\\=\\\"[" + hrefCharacters + "]*\\\")|(?:\\sstyle\\=\\\"[" + attributeCharacters + "]*\\\"))*)(?:\\&gt\\;|\\>)", "<$1$2>", RegexOptions.IgnoreCase | RegexOptions.ECMAScript);

result = Regex.Replace(result, "&?lt;", "<");
result = Regex.Replace(result, "&?gt;", ">");
result = Regex.Replace(result, "&lt;", "<");
result = Regex.Replace(result, "&gt;", ">");

result = Regex.Replace(result, "&amp;", "&", RegexOptions.IgnoreCase);
result = Regex.Replace(result, "&nbsp;", "\xA0", RegexOptions.IgnoreCase);
Expand Down
2 changes: 1 addition & 1 deletion AjaxControlToolkit/Scripts/HtmlEditorExtender.js
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype = {
html = html.replace(/\<(\/?)strong\>/gi, '<$1b>').replace(/\<(\/?)em\>/gi, '<$1i>');

//encode for safe transport
html = html.replace(/&(?!g|lt;)/ig, '&amp;').replace(/\xA0/ig, '&nbsp;');
html = html.replace(/&/ig, '&amp;').replace(/\xA0/ig, '&nbsp;');
html = html.replace(/</ig, '&lt;').replace(/>/ig, '&gt;').replace(/\'/ig, '&apos;').replace(/\"/ig, '&quot;');

return html;
Expand Down
Loading