mirror of
https://github.com/nextcloud/server.git
synced 2026-02-27 18:37:17 +01:00
Merge pull request #58338 from nextcloud/fix/58333/user-files-replace
This commit is contained in:
@@ -47,6 +47,7 @@ use OCP\Share\IShareProviderWithNotification;
|
||||
use OCP\Util;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use function str_starts_with;
|
||||
use function strlen;
|
||||
|
||||
/**
|
||||
* Class DefaultShareProvider
|
||||
@@ -869,7 +870,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 !== '') {
|
||||
|
||||
Reference in New Issue
Block a user