Skip to content

Conversation

@backportbot
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 <[email protected]>
Co-authored-by: Daniel <[email protected]>
Signed-off-by: Ferdinand Thiessen <[email protected]>
@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

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

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 <[email protected]>
Co-authored-by: Côme Chilliet <[email protected]>
Signed-off-by: Ferdinand Thiessen <[email protected]>
@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
@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

6 participants