diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-09-11 01:14:56 +0200 |
---|---|---|
committer | Daniel Kesselberg <mail@danielkesselberg.de> | 2024-09-15 21:40:27 +0200 |
commit | 27300ac6ce8ed960f1126e1c758c8fe1a2e0fffa (patch) | |
tree | a30283d69b45878b9a28e66ab25692175bd9db0a /lib | |
parent | d5985984207fa9483fbaaf17f1d5f67e37c099b4 (diff) | |
download | nextcloud-server-27300ac6ce8ed960f1126e1c758c8fe1a2e0fffa.tar.gz nextcloud-server-27300ac6ce8ed960f1126e1c758c8fe1a2e0fffa.zip |
fix(setup-checks): Ensure URL with webroot works
We basically mock the way `URLGenerator::getAbsoluteURL` works,
so we must make sure that the URL might already contain the webroot.
Because `baseURL` and `cliURL` also contain the webroot we need to remove
the webroot from the URL first.
Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Co-authored-by: Daniel <mail@danielkesselberg.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/base.php | 2 | ||||
-rw-r--r-- | lib/private/URLGenerator.php | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/base.php b/lib/base.php index 4e66d389e7b..7654aef2b60 100644 --- a/lib/base.php +++ b/lib/base.php @@ -43,7 +43,7 @@ class OC { */ private static string $SUBURI = ''; /** - * the Nextcloud root path for http requests (e.g. nextcloud/) + * the Nextcloud root path for http requests (e.g. /nextcloud) */ public static string $WEBROOT = ''; /** diff --git a/lib/private/URLGenerator.php b/lib/private/URLGenerator.php index ab568a3296d..39b825e427b 100644 --- a/lib/private/URLGenerator.php +++ b/lib/private/URLGenerator.php @@ -245,7 +245,7 @@ class URLGenerator implements IURLGenerator { /** * Makes an URL absolute - * @param string $url the url in the ownCloud host + * @param string $url the url in the Nextcloud host * @return string the absolute version of the url */ public function getAbsoluteURL(string $url): string { @@ -254,7 +254,7 @@ class URLGenerator implements IURLGenerator { if (\OC::$CLI && !\defined('PHPUNIT_RUN')) { return rtrim($this->config->getSystemValueString('overwrite.cli.url'), '/') . '/' . ltrim($url, '/'); } - // The ownCloud web root can already be prepended. + // The Nextcloud web root could already be prepended. if (\OC::$WEBROOT !== '' && str_starts_with($url, \OC::$WEBROOT)) { $url = substr($url, \strlen(\OC::$WEBROOT)); } |