Update Kirby and Composer dependencies

This commit is contained in:
Paul Nicoué 2022-03-22 15:39:39 +01:00
parent f5d3ea5e84
commit ec74d78ba9
382 changed files with 25077 additions and 4955 deletions

View file

@ -121,13 +121,14 @@ return function (App $app) {
return null;
}
$time = empty($field->value) === true ? strtotime($fallback) : $field->toTimestamp();
if ($format === null) {
return $time;
if (empty($field->value) === false) {
$time = $field->toTimestamp();
} else {
$time = strtotime($fallback);
}
return ($app->option('date.handler', 'date'))($format, $time);
$handler = $app->option('date.handler', 'date');
return Str::date($time, $format, $handler);
},
/**
@ -384,7 +385,7 @@ return function (App $app) {
// Obsolete elements, script tags, image maps and form elements have
// been excluded for safety reasons and as they are most likely not
// needed in most cases.
$field->value = strip_tags($field->value, '<b><i><small><abbr><cite><code><dfn><em><kbd><strong><samp><var><a><bdo><br><img><q><span><sub><sup>');
$field->value = strip_tags($field->value, Html::$inlineList);
return $field;
},
@ -392,13 +393,14 @@ return function (App $app) {
* Converts the field content from Markdown/Kirbytext to valid HTML
*
* @param \Kirby\Cms\Field $field
* @param array $options
* @return \Kirby\Cms\Field
*/
'kirbytext' => function (Field $field) use ($app) {
$field->value = $app->kirbytext($field->value, [
'kirbytext' => function (Field $field, array $options = []) use ($app) {
$field->value = $app->kirbytext($field->value, A::merge($options, [
'parent' => $field->parent(),
'field' => $field
]);
]));
return $field;
},
@ -409,13 +411,17 @@ return function (App $app) {
* @since 3.1.0
*
* @param \Kirby\Cms\Field $field
* @param array $options
* @return \Kirby\Cms\Field
*/
'kirbytextinline' => function (Field $field) use ($app) {
$field->value = $app->kirbytext($field->value, [
'parent' => $field->parent(),
'field' => $field
], true);
'kirbytextinline' => function (Field $field, array $options = []) use ($app) {
$field->value = $app->kirbytext($field->value, A::merge($options, [
'parent' => $field->parent(),
'field' => $field,
'markdown' => [
'inline' => true
]
]));
return $field;
},
@ -450,10 +456,11 @@ return function (App $app) {
* Converts markdown to valid HTML
*
* @param \Kirby\Cms\Field $field
* @param array $options
* @return \Kirby\Cms\Field
*/
'markdown' => function (Field $field) use ($app) {
$field->value = $app->markdown($field->value);
'markdown' => function (Field $field, array $options = []) use ($app) {
$field->value = $app->markdown($field->value, $options);
return $field;
},