SecurityPolicy
SecurityPolicy globally blocks accessibility of certain methods and properties.
final class System\Twig\SecurityPolicy
implements
Twig\Sandbox\SecurityPolicyInterface
Properties
protected
$blockedMethods
:
array
= ["getTwig","addDynamicMethod","addDynamicProperty","bindEvent","bindEventOnce","insert","update","delete","write"]
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 | Type | Description |
---|---|---|
$obj | object |
object
|
$method | string |
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 | Type | Description |
---|---|---|
$obj | object |
object
|
$property | string |
string
|
Returns
void
public checkSecurity (array $tags, array $filters, array $functions) : void
Check the provided arguments against this security policy
Parameters
Property | Type | Description |
---|---|---|
$tags | array |
array
Array of tags to be checked against the policy ['tag', 'tag2', 'etc'] |
$filters | array |
array
Array of filters to be checked against the policy ['filter', 'filter2', 'etc'] |
$functions | array |
array
Array of funtions to be checked against the policy ['function', 'function2', 'etc'] |
Returns
void
Copyright © 2024 Winter CMS