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

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

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


Commits:
c5c94a6d by Victor Emanouilov at 2025-12-12T08:43:14+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/c5c94a6d48f67a84f2c68f27983fe0ced7ca4b65

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