-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPurifier.php
More file actions
30 lines (26 loc) · 839 Bytes
/
Purifier.php
File metadata and controls
30 lines (26 loc) · 839 Bytes
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
<?php
/**
* Qubus\Security
*
* @link https://github.com/QubusPHP/security
* @copyright 2020
* @author Joshua Parker <joshua@joshuaparker.dev>
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
declare(strict_types=1);
namespace Qubus\Security;
interface Purifier
{
/**
* Escaping for rich text.
*
* This method should only be used on output. With the exception of uploading
* images, never use this method on input. All inputted data should be
* accepted and then purified on output for optimal results.
*
* @param string $string The string to purify.
* @param bool $isImage Is the string an image?
* @return string|bool|array Escaped rich text.
*/
public function purify(string $string, bool $isImage = false): string|bool|array;
}