Class cRequestValidator
Class to check get and post variables
Copyright: four for business AG <www.4fb.de>
License: http://www.contenido.org/license/LIZENZ.txt
Author: Mischa Holz, Andreas Kummer
Located at classes/class.requestvalidator.php
private
|
#
__construct( )
The constructor sets up the singleton object and reads the config from 'data/config/' . CON_ENVIRONMENT . '/config.http_check.php'. |
public static
|
|
public
boolean
|
#
checkParams( )
Checks every given parameter. Parameters which aren't defined in config.http_check.php are considered to be fine |
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
string
|
|
protected
|
#
logHackTrial( )
Writes a log entry containing information about the request which led to the halt of the execution |
protected
boolean
|
string |
CHECK_INTEGER
|
'/^[0-9]*$/' |
#
Regexp for integers. |
string |
CHECK_PRIMITIVESTRING
|
'/^[a-zA-Z0-9 -_]*$/' |
#
Regexp for primitive strings. |
string |
CHECK_STRING
|
'/^[\w0-9 -_]*$/' |
#
Regexp for strings. |
string |
CHECK_HASH32
|
'/^[a-zA-Z0-9]{32}$/' |
#
Regexp for 32 character hash. |
string |
CHECK_BELANG
|
'/^de_DE|en_US|fr_FR|it_IT|nl_NL$/' |
#
Regexp for valid belang values. |
string |
CHECK_AREASTRING
|
'/^[a-zA-Z_]*$/' |
#
Regexp for valid area values. |
string |
CHECK_PATHSTRING
|
'!([*]*\/)|(dbfs:\/[*]*)|(dbfs:)|(^)$!' |
#
Regexp for validating file upload paths. |
private static
|
$_instance | null |
#
Instance of this class |
protected
string
|
$_logPath |
|
#
Path and filename of logfile |
protected
boolean
|
$_log | true |
#
Flag whether to write log or not. |
protected
string
|
$_configPath |
|
#
Path to config file. |
protected
array
|
$_check | array() |
#
Array with all possible parameters and parameter formats. Structure has to be: |
protected
array
|
$_blacklist | array() |
#
Array with forbidden parameters. If any of these is set the request will be invalid |
protected
string
|
$_failure | '' |
#
Contains first invalid parameter name. |
protected
string
|
$_mode | '' |
#
Current mode |