1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-13 10:15:28 +02:00

Fix issue processwire/processwire-issues#1617 using suggestion from @BitPoet

Co-authored-by: BitPoet <BitPoet@users.noreply.github.com>
This commit is contained in:
Ryan Cramer
2023-06-08 16:31:52 -04:00
parent 2d790b6c64
commit 16d0d77d4c

View File

@@ -149,17 +149,17 @@ class InputfieldRepeater extends Inputfield implements InputfieldItemList {
// custom repeater titles specified
$hasCnt = stripos($repeaterTitle, '#n') !== false;
// update index numbers?
if($hasCnt) {
// replace "#n" with index number of repeater item
$repeaterTitle = str_replace("#n", "#$cnt", $repeaterTitle);
}
if(strpos($repeaterTitle, '#') !== false) {
$repeaterTitle = preg_replace('/#([a-f\d]{3,})/i', "$colorPrefix$1", $repeaterTitle);
if(strpos($repeaterTitle, $colorPrefix) !== false) $hasColorPrefix = true;
}
// update index numbers?
if($hasCnt) {
// replace "#n" with index number of repeater item
$repeaterTitle = str_replace("#n", "#$cnt", $repeaterTitle);
}
if(strpos($repeaterTitle, '{') !== false) {
// formatted {label}
$out = $page->getText($repeaterTitle, true);