Update Composer packages

This commit is contained in:
Paul Nicoué 2023-04-14 16:34:06 +02:00
parent 67c3d8b307
commit 83cb211fe6
219 changed files with 6487 additions and 4444 deletions

View file

@ -66,7 +66,8 @@ return function (App $app) {
try {
$blocks = Blocks::parse($field->value());
$blocks = Blocks::factory($blocks, [
'parent' => $field->parent()
'parent' => $field->parent(),
'field' => $field,
]);
return $blocks->filter('isHidden', false);
} catch (Throwable) {
@ -192,7 +193,8 @@ return function (App $app) {
*/
'toLayouts' => function (Field $field) {
return Layouts::factory(Layouts::parse($field->value()), [
'parent' => $field->parent()
'parent' => $field->parent(),
'field' => $field,
]);
},
@ -276,10 +278,10 @@ return function (App $app) {
* Converts the field value to a Unix timestamp
*
* @param \Kirby\Cms\Field $field
* @return int
* @return int|false
*/
'toTimestamp' => function (Field $field): int {
return strtotime($field->value);
'toTimestamp' => function (Field $field): int|false {
return strtotime($field->value ?? '');
},
/**
@ -326,7 +328,7 @@ return function (App $app) {
* Returns the number of words in the text
*/
'words' => function (Field $field) {
return str_word_count(strip_tags($field->value));
return str_word_count(strip_tags($field->value ?? ''));
},
// manipulators
@ -394,7 +396,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, Html::$inlineList);
$field->value = strip_tags($field->value ?? '', Html::$inlineList);
return $field;
},
@ -481,7 +483,7 @@ return function (App $app) {
* @return \Kirby\Cms\Field
*/
'nl2br' => function (Field $field) {
$field->value = nl2br($field->value, false);
$field->value = nl2br($field->value ?? '', false);
return $field;
},