-
Notifications
You must be signed in to change notification settings - Fork 0
/
CleanHtmlEntities.php
55 lines (47 loc) · 1.28 KB
/
CleanHtmlEntities.php
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
49
50
51
52
53
54
55
<?php
/**
* Qubus\Security
*
* @link https://github.com/QubusPHP/security
* @copyright 2020
* @author Joshua Parker <[email protected]>
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
declare(strict_types=1);
namespace Qubus\Security;
interface CleanHtmlEntities
{
/**
* Escaping for HTML blocks.
*
* @return string Escaped HTML block.
*/
public function html(string $string): string;
/**
* Escaping for textarea.
*
* @return string Escaped string.
*/
public function textarea(string $string): string;
/**
* Escaping for url.
*
* @param string $url The url to be escaped.
* @param array $scheme The url scheme.
* @param bool $encode Whether url params should be encoded.
* @return string The escaped $url after the `esc_url` filter is applied.
*/
public function url(string $url, array $scheme = [], bool $encode = false): string;
/**
* Escaping for HTML attributes.
*
* @return string Escaped HTML attribute.
*/
public function attr(string $string): string;
/**
* Escaping for inline javascript.
*
* @return string Escaped inline javascript.
*/
public function js(string $string): string;
}