@@ -149,7 +149,7 @@ protected function verifyPassword(?string $password): void {
149149 *
150150 * @suppress PhanUndeclaredClassMethod
151151 */
152- protected function generalCreateChecks (IShare $ share, bool $ isUpdate = false ): void {
152+ protected function generalChecks (IShare $ share ): void {
153153 if ($ share ->getShareType () === IShare::TYPE_USER ) {
154154 // We expect a valid user as sharedWith for user shares
155155 if (!$ this ->userManager ->userExists ($ share ->getSharedWith ())) {
@@ -603,7 +603,7 @@ public function createShare(IShare $share): IShare {
603603 // TODO: handle link share permissions or check them
604604 $ this ->canShare ($ share );
605605
606- $ this ->generalCreateChecks ($ share );
606+ $ this ->generalChecks ($ share );
607607
608608 // Verify if there are any issues with the path
609609 $ this ->pathCreateChecks ($ share ->getNode ());
@@ -762,7 +762,7 @@ public function updateShare(IShare $share, bool $onlyValid = true): IShare {
762762 throw new \InvalidArgumentException ($ this ->l ->t ('Cannot share with the share owner ' ));
763763 }
764764
765- $ this ->generalCreateChecks ($ share, true );
765+ $ this ->generalChecks ($ share );
766766
767767 if ($ share ->getShareType () === IShare::TYPE_USER ) {
768768 $ this ->userCreateChecks ($ share );
@@ -1096,7 +1096,7 @@ protected function promoteReshares(IShare $share): void {
10961096 foreach ($ reshareRecords as $ child ) {
10971097 try {
10981098 /* Check if the share is still valid (means the resharer still has access to the file through another mean) */
1099- $ this ->generalCreateChecks ($ child );
1099+ $ this ->generalChecks ($ child );
11001100 } catch (GenericShareException $ e ) {
11011101 /* The check is invalid, promote it to a direct share from the sharer of parent share */
11021102 $ this ->logger ->debug ('Promote reshare because of exception ' . $ e ->getMessage (), ['exception ' => $ e , 'fullId ' => $ child ->getFullId ()]);
0 commit comments