trait TemplateSafeness

Properties

protected array $markedSafe

Methods

bool
isSafe(string $context)

Return whether this object is safe to be used in given context

bool
isSafeAsURL()

Return whether this object is safe to be used as a URL

bool
isSafeInCSS()

Return whether this object is safe to be used in CSS

bool
isSafeInJS()

Return whether this object is safe to be used in JavaScript

markAsSafeAsURL()

Return whether this object is safe to be used as a URL

markAsSafeInCSS()

Return whether this object is safe to be used in CSS

markAsSafeInJS()

Return whether this object is safe to be used in JavaScript

resetSafeness()

Reset the "marked safe" statuses

Details

at line 23
protected bool isSafe(string $context)

Return whether this object is safe to be used in given context

Parameters

string $context

Either 'AsURL', 'InCSS' or 'InJS'

Return Value

bool

at line 34
bool isSafeAsURL()

Return whether this object is safe to be used as a URL

Return Value

bool

at line 44
bool isSafeInCSS()

Return whether this object is safe to be used in CSS

Return Value

bool

at line 54
bool isSafeInJS()

Return whether this object is safe to be used in JavaScript

Return Value

bool

at line 64
TemplateSafeness markAsSafeAsURL()

Return whether this object is safe to be used as a URL

Return Value

TemplateSafeness

at line 76
TemplateSafeness markAsSafeInCSS()

Return whether this object is safe to be used in CSS

Return Value

TemplateSafeness

at line 88
TemplateSafeness markAsSafeInJS()

Return whether this object is safe to be used in JavaScript

Return Value

TemplateSafeness

at line 100
TemplateSafeness resetSafeness()

Reset the "marked safe" statuses

Return Value

TemplateSafeness