From ffb8ed0c9df2444727e49f16f7e43ea70184dc4b Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sat, 25 Jul 2026 20:46:21 +0900 Subject: [PATCH] treewide: sanitize various user-provided inputs --- www/admin/aktiviteter/index.php | 7 ++++--- www/aktiviteter/index.php | 11 ++++++----- www/galleri/index.php | 4 ++-- www/hendelser/info.php | 7 ++++--- www/prosjekt/mine.php | 2 +- 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/www/admin/aktiviteter/index.php b/www/admin/aktiviteter/index.php index a368d7b..60adf6a 100644 --- a/www/admin/aktiviteter/index.php +++ b/www/admin/aktiviteter/index.php @@ -92,12 +92,13 @@ $events = array_values(array_filter(
  • -

    getName() . ' (ID: ' . $eventID . ')'; ?>

    +

    getName()) . ' (ID: ' . $eventID . ')'; ?>

    getStart()->format('(Y-m-d H:i:s)') . ' - ' . $event->getStop()->format('(Y-m-d H:i:s)'); ?>

    setSafeMode(true); echo $Parsedown->text(implode("\n", $event->getDescription())); ?>
    @@ -132,9 +133,9 @@ $events = array_values(array_filter(

    Filter

    Navn

    - '; ?>
    + '; ?>

    Organisator

    - '; ?>
    + '; ?>
    diff --git a/www/aktiviteter/index.php b/www/aktiviteter/index.php index 704e234..216b61d 100644 --- a/www/aktiviteter/index.php +++ b/www/aktiviteter/index.php @@ -56,18 +56,18 @@ $day = (isset($_GET['day'])) getStart())) { ?> getURL()) { ?>
    - getName(); ?> + getName()); ?> - getName(); ?> + getName()); ?> getImageURL()) { ?> - +
    • Tid: getStart()); ?>
    • -
    • Sted: getLocation(); ?>
    • -
    • Arrangør: getOrganiser(); ?>
    • +
    • Sted: getLocation()); ?>
    • +
    • Arrangør: getOrganiser()); ?>
    getDescription(); ?> @@ -76,6 +76,7 @@ $day = (isset($_GET['day'])) } ?> setSafeMode(true); echo $Parsedown->text(implode("\n", $description)); ?> diff --git a/www/galleri/index.php b/www/galleri/index.php index e781703..9fe13f6 100644 --- a/www/galleri/index.php +++ b/www/galleri/index.php @@ -118,8 +118,8 @@ $imageTemplate = ' '%user' => htmlspecialchars($imguser), '%time' => $modTime, '%name' => htmlspecialchars($displaypath), - '%path' => $serverPath . $value, - '%thumbnail' => $serverPath . '/.thumbnails' . $value . '.png', + '%path' => htmlspecialchars($serverPath . $value), + '%thumbnail' => htmlspecialchars($serverPath . '/.thumbnails' . $value . '.png'), '%realname' => htmlspecialchars($realname), ]; echo strtr($imageTemplate, $vars); diff --git a/www/hendelser/info.php b/www/hendelser/info.php index 17f217b..1dba508 100644 --- a/www/hendelser/info.php +++ b/www/hendelser/info.php @@ -38,17 +38,18 @@ if (!$event) { getRelativeDate(); ?> getStart())) { ?>
    - getName(); ?> + getName()); ?>
    • Tid: getStart()); ?>
    • -
    • Sted: getLocation(); ?>
    • -
    • Arrangør: getOrganiser(); ?>
    • +
    • Sted: getLocation()); ?>
    • +
    • Arrangør: getOrganiser()); ?>
    getDescription(); ?> setSafeMode(true); echo $Parsedown->text(implode("\n", $description)); ?> diff --git a/www/prosjekt/mine.php b/www/prosjekt/mine.php index 0e31994..cfab0c5 100644 --- a/www/prosjekt/mine.php +++ b/www/prosjekt/mine.php @@ -109,7 +109,7 @@ $projects = array_values(array_filter(

    Filter

    Navn

    - '; ?>
    + '; ?>