From b886a6a66c38d08cfc10c326b96862fc894df01a Mon Sep 17 00:00:00 2001 From: onli Date: Mon, 15 Mar 2021 23:31:32 +0100 Subject: [PATCH] Enable array_key_exists for smarty templates Used in 2k11 for PHP 8 compatibility checks --- include/serendipity_smarty_class.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/serendipity_smarty_class.inc.php b/include/serendipity_smarty_class.inc.php index 58d49c45..05319433 100644 --- a/include/serendipity_smarty_class.inc.php +++ b/include/serendipity_smarty_class.inc.php @@ -12,7 +12,7 @@ class Serendipity_Smarty_Security_Policy extends Smarty_Security { // these are the allowed functions only. - default as is - public $php_functions = array('isset', 'empty', 'count', 'sizeof', 'in_array', 'is_array', 'time', 'nl2br', 'class_exists'); + public $php_functions = array('isset', 'empty', 'count', 'sizeof', 'in_array', 'is_array', 'time', 'nl2br', 'class_exists', ); // to disable all PHP functions #public $php_functions = null; @@ -20,7 +20,7 @@ class Serendipity_Smarty_Security_Policy extends Smarty_Security public $php_handling = Smarty::PHP_REMOVE; // = 2 // set allowed modifiers only. (default = array( 'escape', 'count' );) - public $php_modifiers = array('escape', 'sprintf', 'sizeof', 'count', 'rand', 'print_r', 'str_repeat', 'nl2br'); + public $php_modifiers = array('escape', 'sprintf', 'sizeof', 'count', 'rand', 'print_r', 'str_repeat', 'nl2br', 'array_key_exists'); public $allow_constants = true;