MarkdownSanitizer::sanitizeInput()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
/**
3
 * Class MarkdownSanitizer
4
 *
5
 * @filesource   MarkdownSanitizer.php
6
 * @created      25.04.2018
7
 * @package      chillerlan\BBCode\Output\Markdown
8
 * @author       smiley <[email protected]>
9
 * @copyright    2018 smiley
10
 * @license      MIT
11
 */
12
13
namespace chillerlan\BBCode\Output\Markdown;
14
15
use chillerlan\BBCode\SanitizerAbstract;
16
17
final class MarkdownSanitizer extends SanitizerAbstract{
18
19
	/**
20
	 * Sanitizes the input before parsing to prevent vulnerabilities or compatibility problems.
21
	 *
22
	 * @param $content string to sanitize
23
	 *
24
	 * @return string
25
	 */
26
	public function sanitizeInput(string $content):string{
27
		// TODO: Implement sanitizeInput() method.
28
		return $content;
29
#		return htmlspecialchars($content, ENT_QUOTES | ENT_SUBSTITUTE | ENT_DISALLOWED | ENT_HTML5, 'UTF-8', false);
30
	}
31
32
	/**
33
	 * Sanitizes the output after parsing to prevent user created xss etc.
34
	 * Here you can run things like HTMLPurifier or whatever
35
	 *
36
	 * @param string $content
37
	 *
38
	 * @return string
39
	 */
40
	public function sanitizeOutput(string $content):string{
41
		// TODO: Implement sanitizeOutput() method.
42
		return $content;
43
	}
44
}
45