From 2e98afbd63bb01a078506b85a70a372b7f5fd216 Mon Sep 17 00:00:00 2001
From: fiwswe <53953985+fiwswe@users.noreply.github.com>
Date: Sun, 9 Oct 2022 16:30:41 +0200
Subject: [PATCH] =?UTF-8?q?Correctly=20interpret=20result=20of=20strpos(?=
 =?UTF-8?q?=E2=80=A6)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

if `%s` happens to be at the start of the string then `strpos(…, '%s')` returns `0`. That evaluates to false in an `if` statement. Thus the replacement will not be applied in that case.
See https://github.com/splitbrain/dokuwiki/pull/3790 for a probable similar issue.
---
 tpl.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tpl.php b/tpl.php
index 23f284b..1334488 100644
--- a/tpl.php
+++ b/tpl.php
@@ -45,7 +45,7 @@ class tpl {
                       $linktarget = wl($data['id'], $data['params'], false, '&');
                   }
       $caption = $lang['btn_' . $data['type']];
-      if(strpos($caption, '%s')) {
+      if(strpos($caption, '%s') !== false) {
                       $caption = sprintf($caption, $data['replacement']);
                   }