DTCMS清除 &

时间:2021-08-21 14:28:14

DTcms.Common\Utils.cs

 #region 清除HTML标记
public static string DropHTML(string Htmlstring)

中的

        Htmlstring.Replace("<", "");
Htmlstring.Replace(">", "");
Htmlstring.Replace("\r\n", "");
Htmlstring.Replace("&emsp;", "");

中的  Htmlstring.Replace("&emsp;", "");   改为

            Htmlstring = Regex.Replace(Htmlstring, @"&emsp;", "", RegexOptions.IgnoreCase);
Htmlstring = Regex.Replace(Htmlstring, @"&amp;", "", RegexOptions.IgnoreCase);
Htmlstring = Regex.Replace(Htmlstring, @"emsp;", "", RegexOptions.IgnoreCase);

相关文章