Completed
Push — master ( 8f43a6...343337 )
by Timothy
23s
created

NoHtml.php ➔ noHtml()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
rs 10
1
<?php
2
3
namespace NoHtml;
4
5
/**
6
 * @source https://paragonie.com/blog/2015/06/preventing-xss-vulnerabilities-in-php-everything-you-need-know
7
 * @param $input
8
 * @param string $encoding
9
 * @return string
10
 */
11
function noHtml($input, $encoding = 'UTF-8')
12
{
13
    return htmlentities($input, ENT_QUOTES | ENT_HTML5, $encoding);
14
}
15