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

@ -200,16 +200,20 @@ return [
},
'submit' => function (string $id) {
$page = Find::page($id);
$title = trim(get('title'));
$slug = trim(get('slug'));
$title = trim(get('title', ''));
$slug = trim(get('slug', ''));
// basic input validation before we move on
if (Str::length($title) === 0) {
throw new InvalidArgumentException(['key' => 'page.changeTitle.empty']);
throw new InvalidArgumentException([
'key' => 'page.changeTitle.empty'
]);
}
if (Str::length($slug) === 0) {
throw new InvalidArgumentException(['key' => 'page.slug.invalid']);
throw new InvalidArgumentException([
'key' => 'page.slug.invalid'
]);
}
// nothing changed
@ -318,7 +322,7 @@ return [
];
},
'submit' => function () {
$title = trim(get('title'));
$title = trim(get('title', ''));
if (Str::length($title) === 0) {
throw new InvalidArgumentException([

View file

@ -7,9 +7,7 @@ $files = require __DIR__ . '/../files/dropdowns.php';
return [
'changes' => [
'pattern' => 'changes',
'options' => function () {
return Dropdown::changes();
}
'options' => fn () => Dropdown::changes()
],
'page' => [
'pattern' => 'pages/(:any)',

View file

@ -5,9 +5,7 @@ use Kirby\Cms\Find;
return [
'page' => [
'pattern' => 'pages/(:any)',
'action' => function (string $path) {
return Find::page($path)->panel()->view();
}
'action' => fn (string $path) => Find::page($path)->panel()->view()
],
'page.file' => [
'pattern' => 'pages/(:any)/files/(:any)',
@ -17,9 +15,7 @@ return [
],
'site' => [
'pattern' => 'site',
'action' => function () {
return site()->panel()->view();
}
'action' => fn () => site()->panel()->view()
],
'site.file' => [
'pattern' => 'site/files/(:any)',