@@ -145,7 +145,7 @@ protected function verifyPassword(?string $password): void {
145145 *
146146 * @suppress PhanUndeclaredClassMethod
147147 */
148- protected function generalCreateChecks (IShare $ share, bool $ isUpdate = false ): void {
148+ protected function generalChecks (IShare $ share ): void {
149149 if ($ share ->getShareType () === IShare::TYPE_USER ) {
150150 // We expect a valid user as sharedWith for user shares
151151 if (!$ this ->userManager ->userExists ($ share ->getSharedWith ())) {
@@ -627,7 +627,7 @@ public function createShare(IShare $share): IShare {
627627 // TODO: handle link share permissions or check them
628628 $ this ->canShare ($ share );
629629
630- $ this ->generalCreateChecks ($ share );
630+ $ this ->generalChecks ($ share );
631631
632632 // Verify if there are any issues with the path
633633 $ this ->pathCreateChecks ($ share ->getNode ());
@@ -786,7 +786,7 @@ public function updateShare(IShare $share, bool $onlyValid = true): IShare {
786786 throw new \InvalidArgumentException ($ this ->l ->t ('Cannot share with the share owner ' ));
787787 }
788788
789- $ this ->generalCreateChecks ($ share, true );
789+ $ this ->generalChecks ($ share );
790790
791791 if ($ share ->getShareType () === IShare::TYPE_USER ) {
792792 $ this ->userCreateChecks ($ share );
@@ -1121,7 +1121,7 @@ protected function promoteReshares(IShare $share): void {
11211121 foreach ($ reshareRecords as $ child ) {
11221122 try {
11231123 /* Check if the share is still valid (means the resharer still has access to the file through another mean) */
1124- $ this ->generalCreateChecks ($ child );
1124+ $ this ->generalChecks ($ child );
11251125 } catch (GenericShareException $ e ) {
11261126 /* The check is invalid, promote it to a direct share from the sharer of parent share */
11271127 $ this ->logger ->debug ('Promote reshare because of exception ' . $ e ->getMessage (), ['exception ' => $ e , 'fullId ' => $ child ->getFullId ()]);
0 commit comments