[TikiWiki-commits] [Git][tikiwiki/tiki][28.x] [FIX] smarty Tikilib ref in installer

"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <693bb97974fc0_2a17f0c0265f8@gitlab-sidekiq-low-urgency-cpu-bound-v2-6b9dcdcfd4-x7866.mail>

Victor Emanouilov pushed to branch 28.x at Tiki Wiki CMS Groupware / Tiki


Commits:
5d342921 by Victor Emanouilov at 2025-12-12T08:42:59+02:00
[FIX] smarty Tikilib ref in installer

- - - - -


2 changed files:

- lib/init/smarty.php
- lib/smarty_tiki/Extension/SmartyTikiExtension.php


Changes:

=====================================
lib/init/smarty.php
=====================================
@@ -127,9 +127,11 @@ class Tiki_Security_Policy extends \Smarty\Security
 
     public function isTrustedModifier($modifier_name, $compiler)
     {
-        $allowed_builtin_php_functions = array_filter(TikiLib::lib('tiki')->get_preference('smarty_security_allowed_builtin_php_functions', [], true));
-        if (in_array($modifier_name, $allowed_builtin_php_functions)) {
-            return true;
+        if ($tikilib = TikiLib::lib('tiki')) {
+            $allowed_builtin_php_functions = array_filter($tikilib->get_preference('smarty_security_allowed_builtin_php_functions', [], true));
+            if (in_array($modifier_name, $allowed_builtin_php_functions)) {
+                return true;
+            }
         }
 
         return parent::isTrustedModifier($modifier_name, $compiler);


=====================================
lib/smarty_tiki/Extension/SmartyTikiExtension.php
=====================================
@@ -47,11 +47,13 @@ class SmartyTikiExtension extends \Smarty\Extension\Base
 
     public function getModifierCallback(string $modifierName)
     {
-        $allowed_builtin_php_functions = array_filter(TikiLib::lib('tiki')->get_preference('smarty_security_allowed_builtin_php_functions', [], true));
-        if (in_array($modifierName, $allowed_builtin_php_functions) && is_callable($modifierName)) {
-            return function (...$args) use ($modifierName) {
-                return call_user_func_array($modifierName, $args);
-            };
+        if ($tikilib = TikiLib::lib('tiki')) {
+            $allowed_builtin_php_functions = array_filter($tikilib->get_preference('smarty_security_allowed_builtin_php_functions', [], true));
+            if (in_array($modifierName, $allowed_builtin_php_functions) && is_callable($modifierName)) {
+                return function (...$args) use ($modifierName) {
+                    return call_user_func_array($modifierName, $args);
+                };
+            }
         }
 
         switch ($modifierName) {



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/5d3429217352da53de54df8917a3b53b00a1559d

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/5d3429217352da53de54df8917a3b53b00a1559d
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.