From ab87bdc04466cf9da95da3670a5db9e30cfce64d Mon Sep 17 00:00:00 2001 From: Michal Kleiner Date: Fri, 10 Apr 2020 15:06:14 +1200 Subject: [PATCH] Fix SS_BASE_URL logic when undefined and docroot without public folder --- src/includes/constants.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/includes/constants.php b/src/includes/constants.php index 783114748..e9c73a5b8 100644 --- a/src/includes/constants.php +++ b/src/includes/constants.php @@ -148,9 +148,9 @@ if (!defined('BASE_URL')) { } $requestURI = $_SERVER['REQUEST_URI']; - // Check if /base/public or /base are in the request + // Check if /base/public or /base are in the request (delimited by /) foreach ([$baseURL, dirname($baseURL)] as $candidate) { - if (stripos($requestURI, $candidate) === 0) { + if (stripos($requestURI, rtrim($candidate, '/') . '/') === 0) { return $candidate; } }