LimeSurvey API - Master branch

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

Methods

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
string

hasUnsafeScheme()

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
bool

isXssUrl()

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
string

multiLanguageFilter()

Defines the customs validation rule for multi language string

public multiLanguageFilter(mixed $value) : string
Parameters
$value : mixed
Return values
string

removeInvisibleChars()

Removes invisible characters from a string.

public static removeInvisibleChars(string $string) : string
Parameters
$string : string
Return values
string

treatSpecialChars()

Decodes URL encoded characters and html entities.

public static treatSpecialChars(string $string) : string
Parameters
$string : string
Return values
string

xssFilter()

Remove any script or dangerous HTML

public xssFilter(null|string $value) : string
Parameters
$value : null|string
Return values
string

validateAttribute()

protected validateAttribute(mixed $object, mixed $attribute) : mixed
Parameters
$object : mixed
$attribute : mixed

        
On this page

Search results