class SecurityPolicy implements Policy

Default-deny security policy. Allowlist permitted tags, filters, functions, methods, and properties.

Constants

All

ALL

Methods

static SecurityPolicy
createSafePolicy()

Creates policy with safe defaults for user-generated templates.

allowTags(array $tags)

No description

allowFilters(array $filters)

No description

allowFunctions(array $functions)

No description

allowMethods(string $class, array $methods)

Adds methods of the given class (or its subclasses) to the allowlist.

allowProperties(string $class, array $properties)

Adds properties of the given class (or its subclasses) to the allowlist.

bool
isTagAllowed(string $tag)

No description

bool
isFilterAllowed(string $filter)

No description

bool
isFunctionAllowed(string $function)

No description

bool
isMethodAllowed(string $class, string $method)

No description

bool
isPropertyAllowed(string $class, string $property)

No description

Details

at line 47
static SecurityPolicy createSafePolicy()

Creates policy with safe defaults for user-generated templates.

Return Value

SecurityPolicy

at line 82
SecurityPolicy allowTags(array $tags)

No description

Parameters

array $tags

Return Value

SecurityPolicy

at line 92
SecurityPolicy allowFilters(array $filters)

No description

Parameters

array $filters

Return Value

SecurityPolicy

at line 102
SecurityPolicy allowFunctions(array $functions)

No description

Parameters

array $functions

Return Value

SecurityPolicy

at line 114
SecurityPolicy allowMethods(string $class, array $methods)

Adds methods of the given class (or its subclasses) to the allowlist.

Use SecurityPolicy::All to allow all methods.

Parameters

string $class
array $methods

Return Value

SecurityPolicy

at line 127
SecurityPolicy allowProperties(string $class, array $properties)

Adds properties of the given class (or its subclasses) to the allowlist.

Use SecurityPolicy::All to allow all properties.

Parameters

string $class
array $properties

Return Value

SecurityPolicy

at line 135
bool isTagAllowed(string $tag)

No description

Parameters

string $tag

Return Value

bool

at line 141
bool isFilterAllowed(string $filter)

No description

Parameters

string $filter

Return Value

bool

at line 147
bool isFunctionAllowed(string $function)

No description

Parameters

string $function

Return Value

bool

at line 153
bool isMethodAllowed(string $class, string $method)

No description

Parameters

string $class
string $method

Return Value

bool

at line 172
bool isPropertyAllowed(string $class, string $property)

No description

Parameters

string $class
string $property

Return Value

bool