Upgrade to 3.6.0

This commit is contained in:
Bastian Allgeier
2021-11-16 14:53:37 +01:00
parent 7388fa4d24
commit 92b7a330fa
318 changed files with 20017 additions and 6878 deletions

View File

@@ -366,7 +366,7 @@ return function (App $app) {
* @return \Kirby\Cms\Field
*/
'html' => function (Field $field) {
$field->value = htmlentities($field->value, ENT_COMPAT, 'utf-8');
$field->value = Html::encode($field->value);
return $field;
},
@@ -498,13 +498,14 @@ return function (App $app) {
*/
'replace' => function (Field $field, array $data = [], string $fallback = '') use ($app) {
if ($parent = $field->parent()) {
$field->value = $field->parent()->toString($field->value, $data, $fallback);
// never pass `null` as the $template to avoid the fallback to the model ID
$field->value = $parent->toString($field->value ?? '', $data, $fallback);
} else {
$field->value = Str::template($field->value, array_replace([
'kirby' => $app,
'site' => $app->site(),
'page' => $app->page()
], $data), $fallback);
], $data), ['fallback' => $fallback]);
}
return $field;