From 9bdc9f1b5a923f1fa341f5b574ec82ee097da7ef Mon Sep 17 00:00:00 2001 From: Adnan ELARAJI Date: Fri, 13 Dec 2024 17:22:52 +0100 Subject: [PATCH 1/2] Fix warnings on webmention endpoint. --- views/webmention_endpoint.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/views/webmention_endpoint.php b/views/webmention_endpoint.php index addbc60..3670c60 100644 --- a/views/webmention_endpoint.php +++ b/views/webmention_endpoint.php @@ -5,12 +5,13 @@ // Set path to your mentions twtxt file: //$logfile = './mentions.txt'; /* Make sure file is writeable */ +require_once("partials/base.php"); $logfile = $config['webmentions_txt_path']; if (!isset($_POST['source']) || !isset($_POST['target'])) { - print('Please send a propper webmention to this endpoint'); header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request'); + print('Please send a propper webmention to this endpoint'); exit; } From 7ac946e0a1280889d97fe982c303dcf775445f2e Mon Sep 17 00:00:00 2001 From: Adnan ELARAJI Date: Fri, 13 Dec 2024 17:42:10 +0100 Subject: [PATCH 2/2] switching to a parse_ini_file instead of requiring full the base.php file for defining $config. --- views/webmention_endpoint.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/webmention_endpoint.php b/views/webmention_endpoint.php index 3670c60..61da4ca 100644 --- a/views/webmention_endpoint.php +++ b/views/webmention_endpoint.php @@ -5,7 +5,7 @@ // Set path to your mentions twtxt file: //$logfile = './mentions.txt'; /* Make sure file is writeable */ -require_once("partials/base.php"); +$config = parse_ini_file('private/config.ini'); $logfile = $config['webmentions_txt_path'];