Completed
Pull Request — master (#2)
by Timothy
03:29
created

NoHtml   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A hp ➔ noHtml() 0 4 1
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