Upgrade to 3.5.7

This commit is contained in:
Bastian Allgeier
2021-07-02 11:34:29 +02:00
parent 5358f8885c
commit 62b533a28f
37 changed files with 329 additions and 233 deletions

View File

@@ -4,6 +4,7 @@ namespace Kirby\Cms;
use Kirby\Image\Image;
use Kirby\Toolkit\A;
use Kirby\Toolkit\Escape;
use Kirby\Toolkit\F;
use Throwable;
@@ -561,6 +562,14 @@ class File extends ModelWithContent
$absolute = $this->parent() !== $params['model'];
}
// escape the default text
// TODO: no longer needed in 3.6
$textQuery = $params['text'] ?? '{{ file.filename }}';
$text = $this->toString($textQuery);
if ($textQuery === '{{ file.filename }}') {
$text = Escape::html($text);
}
return [
'filename' => $this->filename(),
'dragText' => $this->dragText('auto', $absolute ?? false),
@@ -569,7 +578,7 @@ class File extends ModelWithContent
'image' => $image,
'info' => $this->toString($params['info'] ?? false),
'link' => $this->panelUrl(true),
'text' => $this->toString($params['text'] ?? '{{ file.filename }}'),
'text' => $text,
'type' => $this->type(),
'url' => $this->url(),
'uuid' => $uuid,