Argentini.Halide.H3Text.StripDangerousProperties C# (CSharp) Méthode

StripDangerousProperties() public static méthode

Remove all occurrences of dangerous tag properties from a string. Helps to prevent injected javascript from running, etc.
public static StripDangerousProperties ( string strVar ) : String
strVar string String to process.
Résultat String
        public static String StripDangerousProperties(string strVar)
        {
            string retVal = strVar;

            if (FixNull(strVar) == string.Empty)
            {
                return (strVar);
            }
            else
            {
                Regex tags = new Regex(@"[\s]*text[\s]*/[\s]*javascript[\s]*", RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline);
                retVal = tags.Replace(retVal, "");

                return retVal;
            }
        }