Output
in package
Provides static methods for cleansing user input before storing in the database.
Tags
Table of Contents
Properties
- $_purifier : HTMLPurifier
Methods
- getClean() : string|null
- Returns a clean version of an inputted string.
- getDecoded() : string|null
- Returns a decoded version of a clean string.
- getPurified() : string
- Returns a purified version of an inputted string with HTMLPurifier.
- urlEncodeAllowSlashes() : string
- urlencode() a string without encoding slashes.
Properties
$_purifier
private
static HTMLPurifier
$_purifier
Static purifier instance.
Methods
getClean()
Returns a clean version of an inputted string.
public
static getClean(string|null $input) : string|null
Will remove HTML, convert HTML entities, and strip slashes.
Parameters
- $input : string|null
-
The string which will be cleaned
Return values
string|null —Cleaned version of string.
getDecoded()
Returns a decoded version of a clean string.
public
static getDecoded(string|null $input) : string|null
Parameters
- $input : string|null
-
Contains the clean string which will be decoded.
Return values
string|null —Decoded string.
getPurified()
Returns a purified version of an inputted string with HTMLPurifier.
public
static getPurified(string|null $input[, bool $escape_invalid = false ]) : string
Will not remove any HTML tags.
Parameters
- $input : string|null
-
String which will be purified.
- $escape_invalid : bool = false
-
Should invalid HTML be escaped instead of fully removed?
Return values
string —Purified string.
urlEncodeAllowSlashes()
urlencode() a string without encoding slashes.
public
static urlEncodeAllowSlashes(string $input) : string
Parameters
- $input : string
-
String to encode
Return values
string —Encoded string