Template escaping

This commit is contained in:
Lukas Bestle
2022-08-23 22:18:14 +02:00
parent 27acc17eac
commit 435b9f4541
12 changed files with 25 additions and 24 deletions

View File

@@ -33,15 +33,15 @@
</section>
<section class="column text" style="--columns: 4">
<h3>Email</h3>
<p><?= html::email($page->email()) ?></p>
<p><?= Html::email($page->email()) ?></p>
<h3>Phone</h3>
<p><?= html::tel($page->phone()) ?></p>
<p><?= Html::tel($page->phone()) ?></p>
</section>
<section class="column text" style="--columns: 4">
<h3>On the web</h3>
<ul>
<?php foreach ($page->social()->toStructure() as $social): ?>
<li><?= html::a($social->url(), $social->platform()) ?></li>
<li><?= Html::a($social->url(), $social->platform()) ?></li>
<?php endforeach ?>
</ul>
</section>

View File

@@ -21,7 +21,7 @@
<?php snippet('header') ?>
<article>
<h1 class="h1"><?= $page->title()->html() ?></h1>
<h1 class="h1"><?= $page->title()->esc() ?></h1>
<div class="text">
<?= $page->text()->kt() ?>
</div>

View File

@@ -48,7 +48,7 @@
<?php endif ?>
<figcaption>
<span>
<span class="example-name"><?= $album->title()->html() ?></span>
<span class="example-name"><?= $album->title()->esc() ?></span>
</span>
</figcaption>
</figure>

View File

@@ -31,9 +31,9 @@
<article class="note">
<header class="note-header h1">
<h1 class="note-title"><?= $page->title()->html() ?></h1>
<h1 class="note-title"><?= $page->title()->esc() ?></h1>
<?php if ($page->subheading()->isNotEmpty()): ?>
<p class="note-subheading"><small><?= $page->subheading()->html() ?></small></p>
<p class="note-subheading"><small><?= $page->subheading()->esc() ?></small></p>
<?php endif ?>
</header>
<div class="note text">
@@ -44,13 +44,13 @@
<ul class="note-tags">
<?php foreach ($tags as $tag): ?>
<li>
<a href="<?= $page->parent()->url(['params' => ['tag' => $tag]]) ?>"><?= html($tag) ?></a>
<a href="<?= $page->parent()->url(['params' => ['tag' => $tag]]) ?>"><?= esc($tag) ?></a>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<time class="note-date" datetime="<?= $page->date('c') ?>">Published on <?= $page->date() ?></time>
<time class="note-date" datetime="<?= $page->date()->toDate('c') ?>">Published on <?= $page->date()->esc() ?></time>
</footer>
<?php snippet('prevnext') ?>

View File

@@ -26,7 +26,7 @@
<?php if (empty($tag) === false): ?>
<header class="h1">
<h1>
<small>Tag:</small> <?= html($tag) ?>
<small>Tag:</small> <?= esc($tag) ?>
<a href="<?= $page->url() ?>" aria-label="All Notes">&times;</a>
</h1>
</header>

View File

@@ -30,7 +30,7 @@
<?= ($cover = $project->cover()) ? $cover->crop(400, 500) : null ?>
</span>
<figcaption class="img-caption">
<?= $project->title()->html() ?>
<?= $project->title()->esc() ?>
</figcaption>
</figure>
</a>