update Kirby

This commit is contained in:
isUnknown 2025-04-22 16:01:57 +02:00
parent ecd997c895
commit 1b05e91943
47 changed files with 963 additions and 307 deletions

View file

@ -1214,8 +1214,10 @@ class App
* @internal
* @throws \Kirby\Exception\NotFoundException if the home page cannot be found
*/
public function resolve(string|null $path = null, string|null $language = null): mixed
{
public function resolve(
string|null $path = null,
string|null $language = null
): mixed {
// set the current translation
$this->setCurrentTranslation($language);
@ -1263,6 +1265,12 @@ class App
// only try to return a representation
// when the page has been found
if ($page) {
// if extension is the default content type,
// redirect to page URL without extension
if ($extension === 'html') {
return Response::redirect($page->url(), 301);
}
try {
$response = $this->response();
$output = $page->render([], $extension);
@ -1407,7 +1415,7 @@ class App
public function sessionHandler(): AutoSession
{
return $this->sessionHandler ??= new AutoSession(
$this->root('sessions'),
($this->component('session::store'))($this),
$this->option('session', [])
);
}

View file

@ -584,7 +584,7 @@ class File extends ModelWithContent
*/
public function template(): string|null
{
return $this->template ??= $this->content()->get('template')->value();
return $this->template ??= $this->content('default')->get('template')->value();
}
/**

View file

@ -137,7 +137,10 @@ trait FileActions
$template = null;
}
$file = $file->update(['template' => $template]);
$file = $file->update(
['template' => $template],
'default'
);
// resize the file if configured by new blueprint
$create = $file->blueprint()->create();

View file

@ -82,7 +82,7 @@ class System
case 'git':
return $url . '/config';
case 'kirby':
return $url . '/composer.json';
return $url . '/LICENSE.md';
case 'site':
$root = $this->app->root('site');
$files = glob($root . '/blueprints/*.yml');

View file

@ -96,6 +96,9 @@ trait UserActions
/**
* Changes the user password
*
* If this method is used with user input, it is recommended to also
* confirm the current password by the user via `::validatePassword()`
*/
public function changePassword(
#[SensitiveParameter]