Skip to content

Str::template() Removes Token-Like Fields That Don't Have Mappings #2307

@neildaniels

Description

@neildaniels

Describe the bug
When using the Str::template() method, if the source string has "token"-like parts to it (but are not meant to be replaced) then they will be unexpectedly removed.

Str::template('From {{ b }} to {{ a }}, maybe {{ c }}.', [
    'a' => 'there',
    'b' => 'here'
]);
//   Actual: From here to there, maybe .
// Expected: From here to there, maybe {{ c }}.

This actual behavior differs from K2-behavior, and to me it seems like a bug.

Kirby Version
3.3.0

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions