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' It also reads existing local config from 'data/config/' . CON_ENVIRONMENT . '/config.http_check.local.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
Regexp for integers. |
#
'/^[0-9]*$/'
|
string |
CHECK_PRIMITIVESTRING
Regexp for primitive strings. |
#
'/^[a-zA-Z0-9 -_]*$/'
|
string |
CHECK_STRING
Regexp for strings. |
#
'/^[\w0-9 -_]*$/'
|
string |
CHECK_HASH32
Regexp for 32 character hash. |
#
'/^[a-zA-Z0-9]{32}$/'
|
string |
CHECK_BELANG
Regexp for valid belang values. |
#
'/^[a-z]{2}_[A-Z]{2}$/'
|
string |
CHECK_AREASTRING
Regexp for valid area values. |
#
'/^[a-zA-Z_]*$/'
|
string |
CHECK_PATHSTRING
Regexp for validating file upload paths. |
#
'!([*]*\/)|(dbfs:\/[*]*)|(dbfs:)|(^)$!'
|
private static
|
$_instance
Instance of this class |
#
NULL
|
protected
string
|
$_logPath
Path and filename of logfile |
|
protected
boolean
|
$_log
Flag whether to write log or not. |
#
true
|
protected
string
|
$_configPath
Path to config file. |
|
protected
array
|
$_check
Array with all possible parameters and parameter formats. Structure has to be: |
#
array()
|
protected
array
|
$_blacklist
Array with forbidden parameters. If any of these is set the request will be invalid |
#
array()
|
protected
string
|
$_failure
Contains first invalid parameter name. |
#
''
|
protected
string
|
$_mode
Current mode |
#
''
|