fix(tags.php): url encode tag links

This commit is contained in:
Cory Dransfeldt 2025-05-30 09:00:20 -07:00
parent 187c383804
commit 0368d5e8a5
No known key found for this signature in database
3 changed files with 4 additions and 4 deletions

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{ {
"name": "coryd.dev", "name": "coryd.dev",
"version": "8.1.5", "version": "8.1.6",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "coryd.dev", "name": "coryd.dev",
"version": "8.1.5", "version": "8.1.6",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"minisearch": "^7.1.2", "minisearch": "^7.1.2",

View file

@ -1,6 +1,6 @@
{ {
"name": "coryd.dev", "name": "coryd.dev",
"version": "8.1.5", "version": "8.1.6",
"description": "The source for my personal site. Built using 11ty (and other tools).", "description": "The source for my personal site. Built using 11ty (and other tools).",
"type": "module", "type": "module",
"engines": { "engines": {

View file

@ -7,7 +7,7 @@ function renderTags(array $tags): void {
foreach ($tags as $tag) { foreach ($tags as $tag) {
$slug = strtolower(trim($tag)); $slug = strtolower(trim($tag));
echo '<a href="/tags/' . htmlspecialchars($slug) . '">#' . htmlspecialchars($slug) . '</a>'; echo '<a href="/tags/' . rawurlencode($slug) . '">#' . htmlspecialchars($slug) . '</a>';
} }
echo '</div>'; echo '</div>';