From 12c6c665fc4c2b7015a724c5524edbc027f9b1ac Mon Sep 17 00:00:00 2001 From: Roman Date: Fri, 12 Apr 2024 11:53:56 +0200 Subject: [PATCH] removed some TODO tags --- Core/Documents/Install.class.php | 2 -- Core/Objects/Context.class.php | 2 -- Core/Objects/Router/Router.class.php | 3 --- index.php | 6 ++++-- react/shared/elements/data-table.js | 1 - 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Core/Documents/Install.class.php b/Core/Documents/Install.class.php index f0e61b8..7a85bfe 100644 --- a/Core/Documents/Install.class.php +++ b/Core/Documents/Install.class.php @@ -180,8 +180,6 @@ namespace Documents\Install { } } - // TODO: check - $context = $this->getDocument()->getContext(); $config = $context->getConfig(); diff --git a/Core/Objects/Context.class.php b/Core/Objects/Context.class.php index c92a4da..3f45338 100644 --- a/Core/Objects/Context.class.php +++ b/Core/Objects/Context.class.php @@ -91,8 +91,6 @@ class Context { } public function sendCookies(): void { - // TODO: what will we do, when there is a domain mismatch? forbid access or just send cookies for the current domain? or should we send a redirect? - // $domain = $this->getSettings()->getDomain(); $domain = getCurrentHostName(); $this->language->sendCookie($domain); $this->session?->sendCookie($domain); diff --git a/Core/Objects/Router/Router.class.php b/Core/Objects/Router/Router.class.php index 02817c6..6f90216 100644 --- a/Core/Objects/Router/Router.class.php +++ b/Core/Objects/Router/Router.class.php @@ -41,10 +41,7 @@ class Router { } public function run(string $url, array &$pathParams): ?Route { - - // TODO: do we want a global try cache and return status page 500 on any error? $this->requestedUri = $url; - $url = strtok($url, "?"); foreach ($this->routes as $route) { $match = $route->match($url); diff --git a/index.php b/index.php index 77ef994..af26a43 100644 --- a/index.php +++ b/index.php @@ -75,12 +75,14 @@ if ($installation) { if ($route === null) { $response = $router->returnStatusCode(404); } else if (!$settings->isTrustedDomain($currentHostName)) { + $error = "Untrusted Origin. Adjust the 'trusted_domains' setting " . + "to include the current host '$currentHostName' or contact the administrator to resolve this issue"; if ($route instanceof \Core\Objects\Router\ApiRoute) { header("Content-Type: application/json"); http_response_code(403); - $response = json_encode(createError("Untrusted Origin")); + $response = json_encode(createError($error)); } else { - $response = $router->returnStatusCode(403, ["message" => "Untrusted Origin"]); + $response = $router->returnStatusCode(403, ["message" => $error]); } } else { $response = $route->call($router, $pathParams); diff --git a/react/shared/elements/data-table.js b/react/shared/elements/data-table.js index 7df6926..3dfb35a 100644 --- a/react/shared/elements/data-table.js +++ b/react/shared/elements/data-table.js @@ -356,7 +356,6 @@ export class ControlsColumn extends DataColumn { key: "button-" + index, } - // TODO: icon button! if (button.hasOwnProperty("disabled")) { props.disabled = typeof button.disabled === 'function' ? button.disabled(entry, index)