mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 09:42:09 -04:00
fix: remove user part only at the beginning of path
Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
This commit is contained in:
parent
5dacdb5bf6
commit
2e287be4c8
1 changed files with 5 additions and 1 deletions
|
|
@ -40,6 +40,7 @@ use OCP\Share\IShareProviderSupportsAllSharesInFolder;
|
|||
use OCP\Share\IShareProviderWithNotification;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use function str_starts_with;
|
||||
use function strlen;
|
||||
|
||||
/**
|
||||
* Class DefaultShareProvider
|
||||
|
|
@ -862,7 +863,10 @@ class DefaultShareProvider implements
|
|||
|
||||
$nonChildPath = '/';
|
||||
if ($path !== null) {
|
||||
$path = str_replace('/' . $userId . '/files', '', $path);
|
||||
$prefix = '/' . $userId . '/files';
|
||||
if (str_starts_with($path, $prefix)) {
|
||||
$path = substr($path, strlen($prefix));
|
||||
}
|
||||
$path = rtrim($path, '/');
|
||||
|
||||
if ($path !== '') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue