Update Composer packages

This commit is contained in:
Paul Nicoué 2022-12-19 16:26:24 +01:00
parent df93324906
commit 45bdef9a3b
378 changed files with 28466 additions and 28852 deletions

View file

@ -6,6 +6,7 @@ use Kirby\Cms\PluginAssets;
use Kirby\Panel\Panel;
use Kirby\Panel\Plugins;
use Kirby\Toolkit\Str;
use Kirby\Uuid\Uuid;
return function ($kirby) {
$api = $kirby->option('api.slug', 'api');
@ -101,6 +102,26 @@ return function ($kirby) {
return Panel::router($path);
}
],
// permalinks for page/file UUIDs
[
'pattern' => '@/(page|file)/(:all)',
'method' => 'ALL',
'env' => 'site',
'action' => function (string $type, string $id) use ($kirby) {
// try to resolve to model, but only from UUID cache;
// this ensures that only existing UUIDs can be queried
// and attackers can't force Kirby to go through the whole
// site index with a non-existing UUID
if ($model = Uuid::for($type . '://' . $id)?->model(true)) {
return $kirby
->response()
->redirect($model->url());
}
// render the error page
return false;
}
],
];
// Multi-language setup