V2:Configuration
From PhpInputValidator
The phpInputValidator has v2:Default configuration settings that will be setup when no values override them. So if you do not want to configure the system you don't have to.
Contents
|
How to configure
To configure phpInputValidator you need to pass an array of configuration values to the constructor when creating a new instance of the class. Here is an example:
$getvar = new phpInputValidator($config);
Configuration options
add_slashes_function (string)
A function to run to add slashes to data. By default the php function addslashes is run to add slashes to a string.
However it is generally better to run a DB specific function for adding slashes. A couple of examples of better functions to use might be mysqli_real_escape_string or mysql_real_escape_string. Which you can use by using this configuration option.
Example
append_unset (array)
Allows to append global variables to not unset if the unset global function is run
Example
date_format (string)
This is the formatting you wish to apply to the date and time on logged events. The string needs to follow the php date function formatting. An example: 'D, d M Y H:i'
Example
error_log (string)
This is the name you wish to give the error log
Example
html_purifier_config (array of strings)
Any configuration you want to use with HTMLPurifier. You must have HTMLPurifier installed and a valid html_purifier_path to use this option. See the HTMLPurifier configuration docs for more information.
Example
'HTML' => array('TidyLevel' => 'heavy', 'Doctype' => 'XHTML 1.0 Transitional'),
'Core' => array('EscapeNonASCIICharacters' => true),
););
html_purifier_path (string)
The absolute path to the location of HTMLPurifier.
Example
language (string)
The language file to load.
Example
log_path (string)
The absolute path to the location to put log files.
Example
security (array)
unset_globals (bool)
Run the unset variables function.