LSYii_Validators
extends CValidator
in package
Table of Contents
Properties
- $fixCKeditor : bool
- Filter attribute for fixCKeditor
- $isLanguage : bool
- Filter attribute for isLanguage
- $isLanguageMulti : bool
- Filter attribute for isLanguageMulti (multi language string)
- $isUrl : bool
- Filter attribute for url
- $xssfilter : bool
- Filter attribute for XSS
Methods
- __construct() : mixed
- fixCKeditor() : string
- Remove some empty characters put by CK editor Did we need to do if user don't use inline HTML editor ?
- hasUnsafeScheme() : bool
- Checks if URL contains an unsafe scheme.
- isXssUrl() : bool
- Checks whether an URL seems unsafe in terms of XSS.
- languageFilter() : string
- Defines the customs validation rule for language string
- multiLanguageFilter() : string
- Defines the customs validation rule for multi language string
- removeInvisibleChars() : string
- Removes invisible characters from a string.
- treatSpecialChars() : string
- Decodes URL encoded characters and html entities.
- xssFilter() : string
- Remove any script or dangerous HTML
- validateAttribute() : mixed
Properties
$fixCKeditor
Filter attribute for fixCKeditor
public
bool
$fixCKeditor
= \false
$isLanguage
Filter attribute for isLanguage
public
bool
$isLanguage
= \false
$isLanguageMulti
Filter attribute for isLanguageMulti (multi language string)
public
bool
$isLanguageMulti
= \false
$isUrl
Filter attribute for url
public
bool
$isUrl
= \false
$xssfilter
Filter attribute for XSS
public
bool
$xssfilter
= \true
Methods
__construct()
public
__construct() : mixed
fixCKeditor()
Remove some empty characters put by CK editor Did we need to do if user don't use inline HTML editor ?
public
fixCKeditor(string $value) : string
Parameters
- $value : string
Return values
stringhasUnsafeScheme()
Checks if URL contains an unsafe scheme.
public
static hasUnsafeScheme(string $url) : bool
It currently checks for "javascript:" only. Note: URL should be previously decoded.
Parameters
- $url : string
Return values
boolisXssUrl()
Checks whether an URL seems unsafe in terms of XSS.
public
static isXssUrl(string $url) : bool
Parameters
- $url : string
Return values
bool —Returns true if the URL is unsafe.
languageFilter()
Defines the customs validation rule for language string
public
languageFilter(mixed $value) : string
Parameters
- $value : mixed
Return values
stringmultiLanguageFilter()
Defines the customs validation rule for multi language string
public
multiLanguageFilter(mixed $value) : string
Parameters
- $value : mixed
Return values
stringremoveInvisibleChars()
Removes invisible characters from a string.
public
static removeInvisibleChars(string $string) : string
Parameters
- $string : string
Return values
stringtreatSpecialChars()
Decodes URL encoded characters and html entities.
public
static treatSpecialChars(string $string) : string
Parameters
- $string : string
Return values
stringxssFilter()
Remove any script or dangerous HTML
public
xssFilter(null|string $value) : string
Parameters
- $value : null|string
Return values
stringvalidateAttribute()
protected
validateAttribute(mixed $object, mixed $attribute) : mixed
Parameters
- $object : mixed
- $attribute : mixed