Upgrade to 3.5.8

This commit is contained in:
Bastian Allgeier
2021-11-16 10:46:50 +01:00
parent 5cb8dd0bd9
commit 7388fa4d24
13 changed files with 1340 additions and 34 deletions

View File

@@ -9,7 +9,7 @@ $ratio = $block->ratio()->or('auto');
$src = null;
if ($block->location() == 'web') {
$src = $block->src();
$src = $block->src()->esc();
} elseif ($image = $block->image()->toFile()) {
$alt = $alt ?? $image->alt();
$src = $image->url();
@@ -19,11 +19,11 @@ if ($block->location() == 'web') {
<?php if ($src): ?>
<figure<?= attr(['data-ratio' => $ratio, 'data-crop' => $crop], ' ') ?>>
<?php if ($link->isNotEmpty()): ?>
<a href="<?= $link->toUrl() ?>">
<img src="<?= $src ?>" alt="<?= $alt ?>">
<a href="<?= esc($link->toUrl()) ?>">
<img src="<?= $src ?>" alt="<?= $alt->esc() ?>">
</a>
<?php else: ?>
<img src="<?= $src ?>" alt="<?= $alt ?>">
<img src="<?= $src ?>" alt="<?= $alt->esc() ?>">
<?php endif ?>
<?php if ($caption->isNotEmpty()): ?>

View File

@@ -1,5 +1,7 @@
<?php
use Kirby\Sane\Html;
return [
'props' => [
/**
@@ -27,7 +29,7 @@ return [
],
'computed' => [
'value' => function () {
return trim($this->value);
return Html::sanitize(trim($this->value));
}
],
];