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
Author: Andreas Kummer
Located at classes/class.requestvalidator.php
private
|
#
__construct( )
Constructor to create an instance of this class. The constructor sets up the
singleton object and reads the config from |
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
boolean
|
|
public
string
|
|
protected
|
#
logHackTrial( )
Writes a log entry containing information about the request which led to the halt of the execution. |
public static
string
|
|
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
|
'/^[a-z]{2}_[A-Z]{2}$/' |
#
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: $check['GET']['param1'] = VALIDATE_FORMAT; $check['POST']['param2'] = VALIDATE_FORMAT; Possible formats are defined as constants in top of these class file. |
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. |