Argentini.Halide.H3Text.StripScripts C# (CSharp) Method

StripScripts() public static method

Return the current string with potentially dangerous script tags removed. Dangerous scriptable tags that are removed include:

applet, body, embed, frame, script, frameset, html, iframe, img, style, layer, link, ilayer, meta, object.

javascript properties injected into other tags are also removed.

public static StripScripts ( string strVar ) : String
strVar string String to process.
return String
        public static String StripScripts(string strVar)
        {
            string retVal = strVar;

            if (FixNull(strVar) == string.Empty)
            {
                return (strVar);
            }
            else
            {
                retVal = StripSpecificTag(retVal, "applet");
                retVal = StripSpecificTag(retVal, "body");
                retVal = StripSpecificTag(retVal, "embed");
                retVal = StripSpecificTag(retVal, "frame");
                retVal = StripSpecificTag(retVal, "script");
                retVal = StripSpecificTag(retVal, "frameset");
                retVal = StripSpecificTag(retVal, "html");
                retVal = StripSpecificTag(retVal, "iframe");
                retVal = StripSpecificTag(retVal, "img");
                retVal = StripSpecificTag(retVal, "style");
                retVal = StripSpecificTag(retVal, "layer");
                retVal = StripSpecificTag(retVal, "link");
                retVal = StripSpecificTag(retVal, "ilayer");
                retVal = StripSpecificTag(retVal, "meta");
                retVal = StripSpecificTag(retVal, "object");

                retVal = StripDangerousProperties(retVal);

                return retVal;
            }
        }