Skip to content

fix: remove user part only at the beginning of path#58338

Open
salmart-dev wants to merge 1 commit intomasterfrom
fix/58333/user-files-replace
Open

fix: remove user part only at the beginning of path#58338
salmart-dev wants to merge 1 commit intomasterfrom
fix/58333/user-files-replace

Conversation

@salmart-dev
Copy link
Contributor

@salmart-dev salmart-dev commented Feb 13, 2026

Summary

Fix for #58333 in server share provider

Replaces str_replace with a str_starts_with + substr for stripping the user portion off the path.

Checklist

Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
@salmart-dev
Copy link
Contributor Author

/backport to stable33

@salmart-dev salmart-dev marked this pull request as ready for review February 16, 2026 09:27
@salmart-dev salmart-dev requested a review from a team as a code owner February 16, 2026 09:27
@salmart-dev salmart-dev requested review from ArtificialOwl, CarlSchwan, come-nc and icewind1991 and removed request for a team February 16, 2026 09:27
Comment on lines +873 to +875
if (str_starts_with($path, '/' . $userId . '/files')) {
$path = substr($path, strlen('/' . $userId . '/files'));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (str_starts_with($path, '/' . $userId . '/files')) {
$path = substr($path, strlen('/' . $userId . '/files'));
}
$prefix = '/' . $userId . '/files';
if (str_starts_with($path, $prefix)) {
$path = substr($path, strlen($prefix));
}

To avoid that they get out-of-sync accidentally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants