This class is the extended version of excelent code made by kummer.

deprecated [2012-07-03] This class was replaced by cRequestValidator
version 1.0.1
see \global\http://contenido.org/forum/viewtopic.php?p=113492#113492

 Methods

Constructor

HttpInputValidator() : \HttpInputValidator

Configuration path $sConfigPath is mandatory and has to contain the complete path to configuration file with defined parameters.

The class provides two modes: training and arcade. Training mode only logs violations - if log path is given into log file otherwise as comment into HTML output. Arcade mode is made for killing - every violation will cause an hard exit!

deprecated [2012-07-03] This class was replaced by cRequestValidator

Returns

Checks GET parameters only.

checkGetParams() : bool
Inherited
see \cRequestValidator::checkParams()
inherited_from \cRequestValidator::checkGetParams()

Returns

boolTrue if every parameter is fine

Checks a single parameter.

checkParameter(string $type, string $key, mixed $value) : bool
Inherited
see \cRequestValidator::checkParams()
inherited_from \cRequestValidator::checkParameter()

Parameters

$type

string

GET or POST

$key

string

the key of the parameter

$value

mixed

the value of the parameter

Returns

boolTrue if the parameter is fine

Checks every given parameter.

checkParams() : bool
Inherited

Parameters which aren't defined in config.http_check.php are considered to be fine

inherited_from \cRequestValidator::checkParams()

Returns

boolTrue if every parameter is fine

Checks POST parameters only.

checkPostParams() : bool
Inherited
see \cRequestValidator::checkParams()
inherited_from \cRequestValidator::checkPostParams()

Returns

boolTrue if every parameter is fine

Returns the first bad parameter

getBadParameter() : string
Inherited
inherited_from \cRequestValidator::getBadParameter()

Returns

stringthe key of the bad parameter

Returns the instance of this class.

getInstance() : \cRequestValidator
InheritedStatic
inherited_from \cRequestValidator::getInstance()

Returns

Checks POST param $sKey is unknown (result is null), known but invalid (result is false) or it is known and valid (result is true).

isRegularPost(string $sKey) : mixed
deprecated [2012-07-03] This class was replaced by cRequestValidator

Parameters

$sKey

string

Returns

mixed

Print html comment or returns (depending on flag $bReturn) all POST params.

showPosts($bReturn) : string
deprecated [2012-07-03] This class was replaced by cRequestValidator

Parameters

$bReturn

Returns

string

Checks an array for validity.

checkArray(array $arr, string $type) : bool
Inherited
inherited_from \cRequestValidator::checkArray()

Parameters

$arr

array

the array which has to be checked

$type

string

GET or POST

Returns

booltrue if everything is fine.

Writes a log entry containing information about the request which led to the halt of the execution

logHackTrial() 
Inherited
inherited_from \cRequestValidator::logHackTrial()

The constructor sets up the singleton object and reads the config from 'data/config/' .

__construct() : void
Inherited

CON_ENVIRONMENT . '/config.http_check.php'.

inherited_from \cRequestValidator::__construct()

Exceptions

\cFileNotFoundException if the configuration can not be loaded

 Properties

 

$_blacklist : array
Inherited

If any of these is set the request will be invalid

inherited_from \cRequestValidator::$$_blacklist
 

$_check : array
Inherited

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.

inherited_from \cRequestValidator::$$_check
 

$_configPath : string
Inherited
inherited_from \cRequestValidator::$$_configPath
 

$_failure : string
Inherited
inherited_from \cRequestValidator::$$_failure
 

$_log : boolean
Inherited
inherited_from \cRequestValidator::$$_log
 

$_logPath : string
Inherited
inherited_from \cRequestValidator::$$_logPath
 

$_mode : string
Inherited
inherited_from \cRequestValidator::$$_mode
 

$_instance : \cRequestValidator
Inherited
inherited_from \cRequestValidator::$$_instance

 Constants

 

Regexp for valid area values.

CHECK_AREASTRING : string
Inherited
inherited_from \cRequestValidator::CHECK_AREASTRING
 

Regexp for valid belang values.

CHECK_BELANG : string
Inherited
inherited_from \cRequestValidator::CHECK_BELANG
 

Regexp for 32 character hash.

CHECK_HASH32 : string
Inherited
inherited_from \cRequestValidator::CHECK_HASH32
 

Regexp for integers.

CHECK_INTEGER : string
Inherited
inherited_from \cRequestValidator::CHECK_INTEGER
 

Regexp for validating file upload paths.

CHECK_PATHSTRING : string
Inherited
inherited_from \cRequestValidator::CHECK_PATHSTRING
 

Regexp for primitive strings.

CHECK_PRIMITIVESTRING : string
Inherited
inherited_from \cRequestValidator::CHECK_PRIMITIVESTRING
 

Regexp for strings.

CHECK_STRING : string
Inherited
inherited_from \cRequestValidator::CHECK_STRING