System\Twig\SecurityPolicy

Implements:

  • Twig\Sandbox\SecurityPolicyInterface

SecurityPolicy globally blocks accessibility of certain methods and properties

Protected properties

protected array $blockedProperties

blockedProperties is a list of forbidden properties.

protected array $blockedMethods

blockedMethods is a list of forbidden methods.

Public methods

public void __construct()

__construct

public void checkMethodAllowed($obj, $method)

checkMethodAllowed

Parameters
  • $obj
  • $method

public void checkPropertyAllowed($obj, $property)

checkPropertyAllowed

Parameters
  • $obj
  • $property

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

checkSecurity

Parameters
  • $tags
  • $filters
  • $functions

public void setBlockedMethods($methods)

setBlockedMethods sets the defined blocked methods as lower case

Parameters
  • $methods