jFilter

utility class to check values

package

jelix

subpackage

utils

since 1.0b1

Methods

_construct

_construct() 

cleanAttr

cleanAttr( $node) 
static

Arguments

$node

remove all javascript things in a html content The html content should be a subtree of a body tag, not a whole document

cleanHtml(string $html,  $isXhtml = false) : string
static
since 1.1

Arguments

$html

string

html content

$isXhtml

Response

string

the cleaned html content

check if the given value is a boolean

isBool(string $val) : boolean
static

Arguments

$val

string

the value

Response

boolean

true if it is valid

check if the given value is an email

isEmail(string $val) : boolean
static

Arguments

$val

string

the value

Response

boolean

true if it is valid

check if the given value is a float

isFloat(string $val, integer $min = null, integer $max = null) : boolean
static

Arguments

$val

string

the value

$min

integer

minimum value (optional), null if no minimum

$max

integer

maximum value (optional), null if no maximum

Response

boolean

true if it is valid

check if the given value is an hexadecimal integer

isHexInt(string $val, integer $min = null, integer $max = null) : boolean
static

Arguments

$val

string

the value

$min

integer

minimum value (optional), null if no minimum

$max

integer

maximum value (optional), null if no maximum

Response

boolean

true if it is valid

check if the given value is an integer

isInt(string $val, integer $min = null, integer $max = null) : boolean
static

Arguments

$val

string

the value

$min

integer

minimum value (optional), null if no minimum

$max

integer

maximum value (optional), null if no maximum

Response

boolean

true if it is valid

check if the given value is an IP version 4

isIPv4(string $val) : boolean
static

Arguments

$val

string

the value

Response

boolean

true if it is valid

check if the given value is an IP version 6

isIPv6(string $val) : boolean
static

Arguments

$val

string

the value

Response

boolean

true if it is valid

check if the given value is

isUrl(string $url,  $schemeRequired = false,  $hostRequired = false,  $pathRequired = false,  $queryRequired = false) : boolean
static

Arguments

$url

string

the url

$schemeRequired

$hostRequired

$pathRequired

$queryRequired

Response

boolean

true if it is valid

usePhpFilter

usePhpFilter() 
static

Constants

INVALID_HTML

INVALID_HTML

BAD_SAVE_HTML

BAD_SAVE_HTML