File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1818use OCP \IUser ;
1919use OCP \Server ;
2020use OCP \Share \IShare ;
21+ use function count ;
2122use function str_starts_with ;
2223use function strlen ;
2324use function substr ;
@@ -78,7 +79,7 @@ public function getMountsFromMountPoints(
7879 array $ mountProviderArgs ,
7980 IStorageFactory $ loader ,
8081 ): array {
81- if (empty ($ mountsInfo )) {
82+ if (\ empty ($ mountProviderArgs )) {
8283 return [];
8384 }
8485
@@ -93,7 +94,7 @@ public function getMountsFromMountPoints(
9394 $ uniqueMountOwnerIds = array_keys ($ uniqueMountOwnerIds );
9495
9596 // make sure the MPs belong to the same user
96- if (count ($ uniqueMountOwnerIds ) !== 1 ) {
97+ if ($ user === null || count ($ uniqueMountOwnerIds ) !== 1 ) {
9798 // question: what kind of exception to throw in here?
9899 throw new LogicException ();
99100 }
Original file line number Diff line number Diff line change @@ -286,11 +286,10 @@ public function getMountsFromMountPoints(
286286 array $ mountProviderArgs ,
287287 IStorageFactory $ loader ,
288288 ): array {
289- /**
290- * If path and count of mount info match, we can use the getsharedwith
291- * If we get a path passed which doesn't match the MP in the infos we
292- * get, it means we are loading data for a collection.
293- */
289+ if (empty ($ mountProviderArgs )) {
290+ return [];
291+ }
292+
294293 $ uniqueMountOwnerIds = [];
295294 $ uniqueRootIds = [];
296295 $ user = null ;
@@ -305,7 +304,7 @@ public function getMountsFromMountPoints(
305304 $ uniqueRootIds = array_keys ($ uniqueRootIds );
306305
307306 // make sure the MPs belong to the same user
308- if (count ($ uniqueMountOwnerIds ) !== 1 ) {
307+ if ($ user === null || count ($ uniqueMountOwnerIds ) !== 1 ) {
309308 // question: what kind of exception to throw in here?
310309 throw new LogicException ();
311310 }
You can’t perform that action at this time.
0 commit comments