forked from wikimedia/mediawiki-extensions-Widgets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWidgetSecurity.php
40 lines (32 loc) · 1.19 KB
/
WidgetSecurity.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
class WidgetSecurity extends Smarty_Security {
/** @var array|null Trusted static classes; empty array allows all, null allows none */
public $static_classes = null;
/** @var array|null Trusted methods from static classes; empty array allows all, null allows none */
public $trusted_static_methods = null;
/** @var array|null Trusted methods from static properties; empty array allows all, null allows none */
public $trusted_static_properties = null;
/** @var array|null Trusted streams; empty array allows all, null allows none */
public $streams = null;
/** @var bool If true, templates can access constants */
public $allow_constants = false;
/** @var bool If true, templates can access superglobals */
public $allow_super_globals = false;
/** @var array Blacklist of $smarty.* variables */
public $disabled_special_smarty_vars = [
'template',
'template_object',
'current_dir'
];
/**
* @param array ...$args
*/
public function __construct( ...$args ) {
if ( defined( "Smarty::PHP_PASSTHRU" ) ) {
// This is removed in newer versions of smarty.
// Set as default for consistency.
$this->php_handling = Smarty::PHP_PASSTHRU;
}
parent::__construct( ...$args );
}
}