\TriTan\InterfacesSanitizeInterface

Summary

Methods
Constants
key()
string()
username()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

key()

key(string  $key) : string

Sanitizes a string key.

Parameters

string $key

String key

Returns

string —

Sanitized key

string()

string(string  $string, string  $fallback_string = '', string  $context = 'save') : string

Sanitizes a string, or returns a fallback string.

Specifically, HTML and PHP tags are stripped. Further actions can be added via the plugin API. If $string is empty and $fallback_string is set, the latter will be used.

Parameters

string $string

The string to be sanitized.

string $fallback_string

Optional. A string to use if $string is empty.

string $context

Optional. The operation for which the string is sanitized

Returns

string —

The sanitized string.

username()

username(string  $username, boolean  $strict = false) : string

Sanitizes a username, stripping out unsafe characters.

Parameters

string $username

The username to be sanitized.

boolean $strict

If set, limits $username to specific characters. Default false.

Returns

string —

Sanitized username.