-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathIHtmlValidator.cs
48 lines (43 loc) · 2.14 KB
/
IHtmlValidator.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using System;
using System.Collections.Generic;
namespace GalleryServerPro.Business.Interfaces
{
/// <summary>
/// Provides functionality for validating and cleaning HTML.
/// </summary>
public interface IHtmlValidator
{
/// <summary>
/// Gets the list of HTML tags found in the user-entered input that are not allowed. This property is set after
/// the <see cref="Validate"/> method is invoked. Guaranteed to not be null.
/// </summary>
/// <value>The list of HTML tags found in the user-entered input that are not allowed.</value>
List<String> InvalidHtmlTags { get; }
/// <summary>
/// Gets the list of HTML attributes found in the user-entered input that are not allowed. This property is set after
/// the <see cref="Validate"/> method is invoked. Guaranteed to not be null.
/// </summary>
/// <value>The list of HTML attributes found in the user-entered input that are not allowed.</value>
List<String> InvalidHtmlAttributes { get; }
/// <summary>
/// Gets a value indicating whether invalid javascript was detected in the HTML. This property is set after
/// the <see cref="Validate"/> method is invoked. Returns <c>true</c> only when the configuration setting
/// allowUserEnteredJavascript is <c>false</c> and either a script tag or the string "javascript:" is detected.
/// </summary>
/// <value>
/// <c>true</c> if invalid javascript is detected; otherwise, <c>false</c>.
/// </value>
bool InvalidJavascriptDetected { get; }
/// <summary>
/// Evaluates the HTML for invalid tags, attributes, and javascript. After executing this method the <see cref="IsValid"/>
/// property can be checked. If this property is <c>true</c>, the properties <see cref="InvalidHtmlTags"/>,
/// <see cref="InvalidHtmlAttributes"/>, and <see cref="InvalidJavascriptDetected"/> can be inspected for details.
/// </summary>
void Validate();
/// <summary>
/// Gets a value indicating whether any invalid HTML tags, attributes, or javascript was found in the HTML.
/// </summary>
/// <value><c>true</c> if invalid HTML tags, attributes, or javascript was found; otherwise, <c>false</c>.</value>
bool IsValid { get; }
}
}