aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/smarty/smarty/libs/sysplugins/smarty_security.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/smarty/smarty/libs/sysplugins/smarty_security.php')
-rw-r--r--vendor/smarty/smarty/libs/sysplugins/smarty_security.php34
1 files changed, 3 insertions, 31 deletions
diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_security.php b/vendor/smarty/smarty/libs/sysplugins/smarty_security.php
index 3c29c8132..97cd0521d 100644
--- a/vendor/smarty/smarty/libs/sysplugins/smarty_security.php
+++ b/vendor/smarty/smarty/libs/sysplugins/smarty_security.php
@@ -19,6 +19,7 @@
/**
* This class does contain the security settings
*/
+#[\AllowDynamicProperties]
class Smarty_Security
{
@@ -105,7 +106,7 @@ class Smarty_Security
*
* @var array
*/
- public $php_modifiers = array('escape', 'count', 'nl2br',);
+ public $php_modifiers = array('escape', 'count', 'sizeof', 'nl2br',);
/**
* This is an array of allowed tags.
@@ -328,7 +329,7 @@ class Smarty_Security
*
* @param string $modifier_name
* @param object $compiler compiler object
- *
+ * @deprecated
* @return boolean true if modifier is trusted
*/
public function isTrustedPhpModifier($modifier_name, $compiler)
@@ -556,35 +557,6 @@ class Smarty_Security
}
/**
- * Check if directory of file resource is trusted.
- *
- * @param string $filepath
- *
- * @return boolean true if directory is trusted
- * @throws SmartyException if PHP directory is not trusted
- */
- public function isTrustedPHPDir($filepath)
- {
- if (empty($this->trusted_dir)) {
- throw new SmartyException("directory '{$filepath}' not allowed by security setting (no trusted_dir specified)");
- }
- // check if index is outdated
- if (!$this->_trusted_dir || $this->_trusted_dir !== $this->trusted_dir) {
- $this->_php_resource_dir = array();
- $this->_trusted_dir = $this->trusted_dir;
- foreach ((array)$this->trusted_dir as $directory) {
- $directory = $this->smarty->_realpath($directory . '/', true);
- $this->_php_resource_dir[ $directory ] = true;
- }
- }
- $addPath = $this->_checkDir($filepath, $this->_php_resource_dir);
- if ($addPath !== false) {
- $this->_php_resource_dir = array_merge($this->_php_resource_dir, $addPath);
- }
- return true;
- }
-
- /**
* Remove old directories and its sub folders, add new directories
*
* @param array $oldDir