SecurityPolicy

SecurityPolicy globally blocks accessibility of certain methods and properties.

final class System\Twig\SecurityPolicy
implements 
    Twig\Sandbox\SecurityPolicyInterface

Properties

protected $blockedMethods : array

List of forbidden methods.

Methods

public __construct ()

Constructor

Returns
mixed

public checkMethodAllowed (object $obj, string $method) : void

Checks if a given method is allowed to be called on a given object

Parameters
Property Description
$obj
object
$method
string
Returns
void

public checkPropertyAllowed (object $obj, string $property) : void

Checks if a given property is permitted to be accessed on a given object

Parameters
Property Description
$obj
object
$property
string
Returns
void

public checkSecurity (array $tags, array $filters, array $functions) : void

Check the provided arguments against this security policy

Parameters
Property Description
$tags
array

Array of tags to be checked against the policy ['tag', 'tag2', 'etc']

$filters
array

Array of filters to be checked against the policy ['filter', 'filter2', 'etc']

$functions
array

Array of funtions to be checked against the policy ['function', 'function2', 'etc']

Returns
void
Copyright © 2024 Winter CMS