\Box\Brainy\TemplatesSecurity

Summary

Methods
Properties
Constants
__construct()
isTrustedPhpFunction()
isTrustedPhpModifier()
isTrustedTag()
isTrustedModifier()
isTrustedResourceDir()
$php_functions
$php_modifiers
$allowed_tags
$disabled_tags
$allowed_modifiers
$disabled_modifiers
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$php_functions

$php_functions : array<mixed,string>|null

This is an array of trusted PHP functions.

If empty all functions are allowed. If null, no functions are allowed.

Type

array<mixed,string>|null

$php_modifiers

$php_modifiers : array<mixed,string>|null

This is an array of trusted PHP modifiers.

If empty all modifiers are allowed. If null, no modifiers are allowed.

Type

array<mixed,string>|null

$allowed_tags

$allowed_tags : array<mixed,string>

This is an array of allowed tags.

If empty no restriction by allowed_tags.

Type

array<mixed,string>

$disabled_tags

$disabled_tags : array<mixed,string>

This is an array of disabled tags.

If empty no restriction by disabled_tags.

Type

array<mixed,string>

$allowed_modifiers

$allowed_modifiers : array<mixed,string>

This is an array of allowed modifier plugins.

If empty no restriction by allowed_modifiers.

Type

array<mixed,string>

$disabled_modifiers

$disabled_modifiers : array<mixed,string>

This is an array of disabled modifier plugins.

If empty no restriction by disabled_modifiers.

Type

array<mixed,string>

Methods

__construct()

__construct(\Box\Brainy\Brainy  $smarty) 

Constructs a new security policy

Parameters

\Box\Brainy\Brainy $smarty

An instance of Brainy

isTrustedPhpFunction()

isTrustedPhpFunction(string  $function_name, object  $compiler) : boolean

Check if PHP function is trusted.

Parameters

string $function_name

The name of the PHP function

object $compiler

compiler object

Throws

\Box\Brainy\Templates\SmartyCompilerException

if php function is not trusted

Returns

boolean —

true if function is trusted

isTrustedPhpModifier()

isTrustedPhpModifier(string  $modifier_name, object  $compiler) : boolean

Check if PHP modifier is trusted.

Parameters

string $modifier_name

The name of the PHP function

object $compiler

compiler object

Throws

\Box\Brainy\Templates\SmartyCompilerException

if modifier is not trusted

Returns

boolean —

true if modifier is trusted

isTrustedTag()

isTrustedTag(string  $tag_name, object  $compiler) : boolean

Check if tag is trusted.

Parameters

string $tag_name

The name of the tag

object $compiler

compiler object

Throws

\Box\Brainy\Templates\SmartyCompilerException

if modifier is not trusted

Returns

boolean —

true if tag is trusted

isTrustedModifier()

isTrustedModifier(string  $modifier_name, object  $compiler) : boolean

Check if modifier plugin is trusted.

Parameters

string $modifier_name

The name of the modifier

object $compiler

compiler object

Throws

\Box\Brainy\Templates\SmartyCompilerException

if modifier is not trusted

Returns

boolean —

true if tag is trusted

isTrustedResourceDir()

isTrustedResourceDir(string  $filepath) : boolean

Check if directory of file resource is trusted.

Parameters

string $filepath

The file path to test

Throws

\Box\Brainy\Templates\SmartyException

if directory is not trusted

Returns

boolean —

true if directory is trusted