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

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

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


Commits:
7b34765b by Victor Emanouilov at 2025-12-12T08:42:10+02:00
[FIX] smarty Tikilib ref in installer

- - - - -


2 changed files:

- lib/core/Tiki/Smarty/SecurityPolicy.php
- lib/smarty_tiki/Extension/SmartyTikiExtension.php


Changes:

=====================================
lib/core/Tiki/Smarty/SecurityPolicy.php
=====================================
@@ -115,9 +115,11 @@ class SecurityPolicy 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/7b34765ba951b8ad35e5ca39336a8a0ddde257cc

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/7b34765ba951b8ad35e5ca39336a8a0ddde257cc
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.