using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using XSS1.Models;
using System.Text.RegularExpressions;

namespace XSS1.Filters
{
    public class TagsFilter : ActionFilterAttribute
    {
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            /*
            var post = ((Post)filterContext.ActionParameters["post"]);
            if (!string.IsNullOrEmpty(post.Content))
            {
                Regex scripts = new Regex("<script>[^<>]*</script>");
                post.Content = scripts.Replace(post.Content, "");
                //post.Content = System.Web.Security.AntiXss.AntiXssEncoder.HtmlEncode(post.Content, true);
            }
            */
            base.OnActionExecuting(filterContext);
            
        }

        public override void OnActionExecuted(ActionExecutedContext filterContext)
        {

        }

        public override void OnResultExecuting(ResultExecutingContext filterContext)
        {

        }

        public override void OnResultExecuted(ResultExecutedContext filterContext)
        {

        }
    }
}