From e2c082a14a008da2091e33dc05e9b58684bc71d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?s=C3=B8renpeter?= Date: Sun, 23 Feb 2025 08:58:26 +0100 Subject: [PATCH] Test if media_upload is set, and halt if not --- private/config_template.ini | 3 ++- views/upload_img.php | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/private/config_template.ini b/private/config_template.ini index ca3f521..1f859f1 100644 --- a/private/config_template.ini +++ b/private/config_template.ini @@ -24,7 +24,8 @@ site_title = "Timeline" txt_file_path = "twtxt.txt" ; Path to folder where you want to upload images for your posts -img_upload_dir = "./media" +media_upload = "../twtxt" +public_media = "https://darch.dk/twtxt" ; Full URL for your public twtxt.txt file public_txt_url = "https://example.com/timeline/twtxt.txt" diff --git a/views/upload_img.php b/views/upload_img.php index e0635e6..0cbcce7 100644 --- a/views/upload_img.php +++ b/views/upload_img.php @@ -8,6 +8,8 @@ $title = "Upload - $title"; include_once 'partials/header.php'; +if(!isset($config["media_upload"])) exit("

The path for media_upload is not set in your config.ini

"); + $media_upload = getcwd() . "/" . $config["media_upload"] . "/"; ?> @@ -148,7 +150,7 @@ foreach ($imgs_on_server as $img) { */ echo '
'; echo '![]('.$public_file.')'; - echo ''; + echo ''; echo '
'; }