YKT_Common/Filter.cs

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;

using System.Text;
using System.Text.RegularExpressions;

namespace YKT_Common
{
    public class Filter
    {
        /// <summary>
        /// 过滤HTML
        /// </summary>
        /// <param name="Content"></param>
        /// <returns></returns>
        public static string ClearHTML(string Content)
        {
            if ((Content != null) && (Content != string.Empty))
            {
                Content = Content.Replace("<", "&lt;");
                Content = Content.Replace(">", "&gt;");
            }
            return Content;
        }

        /// <summary>
        /// 清除frame
        /// </summary>
        /// <param name="Content"></param>
        /// <returns></returns>
        public static string ClearIframe(string Content)
        {
            if ((Content != null) && (Content != string.Empty))
            {
                string str = "<iframe|</iframe|<frame|</frame";
                foreach (string str2 in str.Split(new char[] { '|' }))
                {
                    Content = Regexs(Content, str2, "&lt;" + str2.Substring(1));
                }
            }
            return Content;
        }

        /// <summary>
        /// 清除javascript
        /// </summary>
        /// <param name="Content"></param>
        /// <returns></returns>
        public static string ClearJS(string Content)
        {
            if ((Content != null) && (Content != string.Empty))
            {
                Content = ClearIframe(Content);
                Content = Content.Replace("/*", @"\*");
                Content = Content.Replace("*/", @"*\");
                string str = "position|left|top";
                foreach (string str2 in str.Split(new char[] { '|' }))
                {
                    Content = Regexs(Content, @"( style[\s]*=[\s\S]*?)" + str2 + @"[\s]*:[\s]*\w+[\s;]*", "$1");
                }
后面还有 92 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。