]> git.mxchange.org Git - friendica.git/commitdiff
Restore is_string() as a Smarty modifier
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 29 May 2023 23:19:41 +0000 (19:19 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Mon, 29 May 2023 23:19:41 +0000 (19:19 -0400)
- Address https://github.com/friendica/friendica/issues/13157#issuecomment-1567336694

src/Render/FriendicaSmarty.php
view/templates/settings/addons/panel.tpl
view/theme/frio/templates/settings/addons/panel.tpl

index 2ace5688a36fc22e1bf36225ab136da29859bdad..1df1ffe4a8a09d9d90e1ad104c58ded6c845777c 100644 (file)
@@ -53,6 +53,10 @@ class FriendicaSmarty extends Smarty
                $this->setConfigDir($work_dir . '/');
                $this->setCacheDir($work_dir . '/');
 
+               $this->registerPlugin('modifier', 'is_string', function ($value) {
+                       return is_string($value);
+               });
+
                /*
                 * Enable sub-directory splitting for reducing directory descriptor
                 * size. The default behavior is to put all compiled/cached files into
index 77c21ab7ff7798a4b5e7c14430f69aac19b40f42..f401f012317f071fc3a5064f2282c7c9323d32b1 100644 (file)
@@ -8,7 +8,7 @@
        {{$html nofilter}}
 {{if $submit}}
        <div class="settings-submit-wrapper panel-footer">
-    {{if $submit}}
+    {{if $submit|is_string}}
                <button type="submit" name="{{$addon}}-submit" class="btn btn-primary settings-submit" value="{{$submit}}">{{$submit}}</button>
     {{else}}
         {{$count = 1}}
index 3fdba6e3d267f5bb9d54a80d2a1a96735ac8bc16..561d0fc9f3f50db54450f4b87f7be054d1a96dc9 100644 (file)
@@ -11,7 +11,7 @@
                </div>
                <div class="panel-footer">
 {{if $submit}}
-    {{if $submit}}
+    {{if $submit|is_string}}
                        <button type="submit" name="{{$addon}}-submit" class="btn btn-primary settings-submit" value="{{$submit}}">{{$submit}}</button>
     {{else}}
         {{$count = 1}}