Beispiel #1
0
        public virtual AntiySamyResult Scan(string taintedHtml, string filename)
        {
            Policy policy = Policy.FromFile(filename);

            var antiSamy = new AntiSamyDomScanner(policy);

            return(antiSamy.Scan(taintedHtml));
        }
Beispiel #2
0
        /// <summary> This method wraps the actual <c>Scan()</c> using the <see cref="Policy"/> object passed in.</summary>
        /// <param name="taintedHTML">Untrusted HTML which may contain malicious code.</param>
        /// <param name="policy">Policy to use on the scan.</param>
        /// <returns> A <see cref="CleanResults"/> object which contains information about the scan (including the results).</returns>
        /// <exception cref="Exceptions.ScanException"/>
        public CleanResults Scan(string taintedHTML, Policy policy)
        {
            /*
             * Go get 'em!
             */
            if (Scanner == null)
            {
                Scanner = new AntiSamyDomScanner(policy);
            }
            else
            {
                Scanner.Policy = policy;
            }

            return(Scanner.Scan(taintedHTML));
        }
Beispiel #3
0
        public virtual AntiySamyResult Scan(string taintedHtml, Policy policy)
        {
            var antiSamy = new AntiSamyDomScanner(policy);

            return(antiSamy.Scan(taintedHtml));
        }