Skip to content

Commit 8338e86

Browse files
Merge pull request #7642 from nextcloud/fix/58333/user-files-replace
2 parents fd60b5a + 61f7a87 commit 8338e86

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/Sharing/DeckShareProvider.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
use OCP\Share\IPartialShareProvider;
3737
use OCP\Share\IShare;
3838
use OCP\Share\IShareProviderGetUsers;
39+
use function strlen;
3940

4041
/** Taken from the talk shareapicontroller helper */
4142
interface IShareProviderBackend {
@@ -751,7 +752,10 @@ private function _getSharedWith(
751752
}
752753

753754
if ($path !== null) {
754-
$path = str_replace('/' . $userId . '/files', '', $path);
755+
$prefix = '/' . $userId . '/files';
756+
if (str_starts_with($path, $prefix)) {
757+
$path = substr($path, strlen($prefix));
758+
}
755759
$path = rtrim($path, '/');
756760

757761
$onClause = $qb->expr()->andX(

0 commit comments

Comments
 (0)