Upgrade to 3.5.7
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -7,6 +7,7 @@ use Kirby\Exception\InvalidArgumentException;
|
||||
use Kirby\Exception\NotFoundException;
|
||||
use Kirby\Http\Uri;
|
||||
use Kirby\Toolkit\A;
|
||||
use Kirby\Toolkit\Escape;
|
||||
use Kirby\Toolkit\F;
|
||||
|
||||
/**
|
||||
@@ -995,6 +996,14 @@ class Page extends ModelWithContent
|
||||
$image = $this->panelImage($params['image'] ?? []);
|
||||
$icon = $this->panelIcon($image);
|
||||
|
||||
// escape the default text
|
||||
// TODO: no longer needed in 3.6
|
||||
$textQuery = $params['text'] ?? '{{ page.title }}';
|
||||
$text = $this->toString($textQuery);
|
||||
if ($textQuery === '{{ page.title }}') {
|
||||
$text = Escape::html($text);
|
||||
}
|
||||
|
||||
return [
|
||||
'dragText' => $this->dragText(),
|
||||
'hasChildren' => $this->hasChildren(),
|
||||
@@ -1003,7 +1012,7 @@ class Page extends ModelWithContent
|
||||
'image' => $image,
|
||||
'info' => $this->toString($params['info'] ?? false),
|
||||
'link' => $this->panelUrl(true),
|
||||
'text' => $this->toString($params['text'] ?? '{{ page.title }}'),
|
||||
'text' => $text,
|
||||
'url' => $this->url(),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace Kirby\Cms;
|
||||
use Exception;
|
||||
use Kirby\Exception\InvalidArgumentException;
|
||||
use Kirby\Exception\NotFoundException;
|
||||
use Kirby\Toolkit\Escape;
|
||||
use Kirby\Toolkit\F;
|
||||
use Kirby\Toolkit\Str;
|
||||
|
||||
@@ -628,6 +629,14 @@ class User extends ModelWithContent
|
||||
$image = $this->panelImage($params['image'] ?? []);
|
||||
$icon = $this->panelIcon($image);
|
||||
|
||||
// escape the default text
|
||||
// TODO: no longer needed in 3.6
|
||||
$textQuery = $params['text'] ?? '{{ user.username }}';
|
||||
$text = $this->toString($textQuery);
|
||||
if ($textQuery === '{{ user.username }}') {
|
||||
$text = Escape::html($text);
|
||||
}
|
||||
|
||||
return [
|
||||
'icon' => $icon,
|
||||
'id' => $this->id(),
|
||||
@@ -635,7 +644,7 @@ class User extends ModelWithContent
|
||||
'email' => $this->email(),
|
||||
'info' => $this->toString($params['info'] ?? false),
|
||||
'link' => $this->panelUrl(true),
|
||||
'text' => $this->toString($params['text'] ?? '{{ user.username }}'),
|
||||
'text' => $text,
|
||||
'username' => $this->username(),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user