From 3608f57d5bd1a0179df804db583b97f351bc6e24 Mon Sep 17 00:00:00 2001 From: Josh Betz Date: Fri, 1 Sep 2023 11:48:18 -0500 Subject: [PATCH] Admin: Disable the self-hosted domain field if it's hard-coded If we define the `PLAUSIBLE_SELF_HOSTED_DOMAIN` constant, we shouldn't allow you to edit the settings field. Disabling this text field makes it more obvious that you can't. --- src/Admin/Settings/Page.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Admin/Settings/Page.php b/src/Admin/Settings/Page.php index b88f4cb8..2b3dc26b 100644 --- a/src/Admin/Settings/Page.php +++ b/src/Admin/Settings/Page.php @@ -244,7 +244,7 @@ public function __construct() { 'type' => 'text', 'value' => $self_hosted_domain, 'placeholder' => 'e.g. ' . Helpers::get_domain(), - 'disabled' => ! empty( Helpers::get_settings()['proxy_enabled'][0] ), + 'disabled' => ! empty( Helpers::get_settings()['proxy_enabled'][0] ) || defined('PLAUSIBLE_SELF_HOSTED_DOMAIN'), ], [ 'label' => '',