FormattingFunctionsHelper
in package
FinalYes
Helper functions and function lists for checking whether a function is a formatting function.
Tags
Table of Contents
Properties
- $formattingFunctions : array<string, bool>
- Functions that format strings.
Methods
- is_formatting_function() : bool
- Check if a particular function is regarded as a formatting function.
Properties
$formattingFunctions
Functions that format strings.
private
static array<string, bool>
$formattingFunctions
= array('antispambot' => true, 'array_fill' => true, 'ent2ncr' => true, 'implode' => true, 'join' => true, 'nl2br' => true, 'sprintf' => true, 'vsprintf' => true, 'wp_sprintf' => true)
These functions are often used for formatting values just before output, and it is common practice to escape the individual parameters passed to them as needed instead of escaping the entire result. This is especially true when the string being formatted contains HTML, which makes escaping the full result more difficult.
Tags
Methods
is_formatting_function()
Check if a particular function is regarded as a formatting function.
public
static is_formatting_function(string $functionName) : bool
Parameters
- $functionName : string
-
The name of the function to check.