Correctly interpret result of strpos(…)
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.
This commit is contained in:
parent
f6194cf4db
commit
2e98afbd63
1 changed files with 1 additions and 1 deletions
2
tpl.php
2
tpl.php
|
@ -45,7 +45,7 @@ class tpl {
|
||||||
$linktarget = wl($data['id'], $data['params'], false, '&');
|
$linktarget = wl($data['id'], $data['params'], false, '&');
|
||||||
}
|
}
|
||||||
$caption = $lang['btn_' . $data['type']];
|
$caption = $lang['btn_' . $data['type']];
|
||||||
if(strpos($caption, '%s')) {
|
if(strpos($caption, '%s') !== false) {
|
||||||
$caption = sprintf($caption, $data['replacement']);
|
$caption = sprintf($caption, $data['replacement']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue