From ba8e95fa4fc87d85390bf2591abaaa2f60812c23 Mon Sep 17 00:00:00 2001 From: nat Date: Sun, 1 Sep 2024 14:56:21 -0700 Subject: [PATCH] fix: exclude query params from REQUEST_PATH --- etc/config.example.php | 2 ++ public/api/v1/router.php | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/etc/config.example.php b/etc/config.example.php index ef0827c..35fc56d 100644 --- a/etc/config.example.php +++ b/etc/config.example.php @@ -10,3 +10,5 @@ define('HOSTAS_UNIX_USER', 'www-data'); define('HOSTAS_ACCESS_LIST', array( 'example.org' => HOSTAS_ACCESS_LEVEL->trusted )); + +define('HOSTAS_MAX_POSTS_PER_PAGE', 50); diff --git a/public/api/v1/router.php b/public/api/v1/router.php index fff0c0c..ad0b31f 100644 --- a/public/api/v1/router.php +++ b/public/api/v1/router.php @@ -1,9 +1,12 @@ ['', 'api', 'v1', 'test', 'request']. // For convenience later, we take a slice that excludes ['', 'api', 'v1']. -define('REQUEST_PATH', array_slice(explode('/', $_SERVER['REQUEST_URI']), offset: 3)); +define('REQUEST_PATH', array_slice(explode('/', $clean_uri), offset: 3)); switch (REQUEST_PATH[0]) { case 'actor': // /api/v1/actor