aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/note.php
diff options
context:
space:
mode:
authorwinter2025-02-06 20:54:52 +0000
committerwinter2025-02-06 20:54:52 +0000
commit27c2a1df69001f979ad9ed5ffbac06fc106b9e30 (patch)
tree5f22e3ae15797d3add4659dd70e8d78917c4a9f6 /templates/note.php
parent0c9c33d2f626c235ef24d9fabc723be11cd6088b (diff)
allow writing alt text on image attachments
Diffstat (limited to 'templates/note.php')
-rw-r--r--templates/note.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/templates/note.php b/templates/note.php
index f9eef45..b43e63e 100644
--- a/templates/note.php
+++ b/templates/note.php
@@ -79,12 +79,12 @@ if ($user != null) {
<?php foreach ($note->attachments as $attachment): ?>
<div>
<?php if (str_starts_with($attachment->type, 'image/')): ?>
- <img src="<?= $attachment->href ?>" alt="<?= $attachment->description ?? '' ?>"
- title="<?= $attachment->description ?? '' ?>">
+ <img src="<?= $attachment->href ?>" alt="<?= htmlspecialchars($attachment->description ?? '') ?>"
+ title="<?= htmlspecialchars($attachment->description ?? '') ?>">
<?php else: ?>
<a class="file" href="<?= $attachment->href ?>" target="_blank">
<span class="material-symbols attach-file"></span>
- <span><?= $attachment->description ?? basename($attachment->href) ?></span>
+ <span><?= htmlspecialchars($attachment->description ?? basename($attachment->href)) ?></span>
</a>
<?php endif; ?>
</div>