Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable29] fix(setup-checks): Ensure URL with webroot works #47943

Merged
merged 2 commits into from
Oct 11, 2024

Conversation

backportbot[bot]
Copy link

@backportbot backportbot bot commented Sep 13, 2024

Backport of #47883

Warning, This backport's changes differ from the original and might be incomplete ⚠️

Todo

  • Review and resolve any conflicts
  • Amend HEAD commit to remove the line stating to skip CI

Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

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>
@susnux susnux force-pushed the backport/47883/stable29 branch from 549f140 to 6b964d8 Compare October 11, 2024 11:10
@susnux susnux marked this pull request as ready for review October 11, 2024 11:10
@MichaIng MichaIng linked an issue Oct 11, 2024 that may be closed by this pull request
8 tasks
if ($removeWebroot) {
$segments = parse_url($url);
$port = isset($segments['port']) ? (':' . $segments['port']) : '';
return $segments['scheme'] . '://' . $segments['host'] . $port;

Check notice

Code scanning / Psalm

PossiblyUndefinedArrayOffset Note

Possibly undefined array key $segments['scheme'] on array{fragment?: string, host?: string, pass?: string, path?: string, port?: int, query?: string, scheme?: string, user?: string}|false
if ($removeWebroot) {
$segments = parse_url($url);
$port = isset($segments['port']) ? (':' . $segments['port']) : '';
return $segments['scheme'] . '://' . $segments['host'] . $port;

Check notice

Code scanning / Psalm

PossiblyUndefinedArrayOffset Note

Possibly undefined array key $segments['host'] on array{fragment?: string, host?: string, pass?: string, path?: string, port?: int, query?: string, scheme?: string, user?: string}|false
@susnux susnux force-pushed the backport/47883/stable29 branch from 6b964d8 to ef76a2c Compare October 11, 2024 11:21
… path

Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux susnux force-pushed the backport/47883/stable29 branch from ef76a2c to d126fc3 Compare October 11, 2024 11:27
@susnux susnux merged commit 3980061 into stable29 Oct 11, 2024
177 checks passed
@susnux susnux deleted the backport/47883/stable29 branch October 11, 2024 11:49
@Altahrim Altahrim mentioned this pull request Oct 30, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants