diff options
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareAPIController.php | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index a051f9141ff..922623aa46f 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -556,13 +556,13 @@ class ShareAPIController extends OCSController { } // Only share by mail have a recipient - if ($shareType === IShare::TYPE_EMAIL) { + if (is_string($shareWith) && $shareType === IShare::TYPE_EMAIL) { $share->setSharedWith($shareWith); - } else { - // Only link share have a label - if (!empty($label)) { - $share->setLabel($label); - } + } + + // If we have a label, use it + if (!empty($label)) { + $share->setLabel($label); } if ($sendPasswordByTalk === 'true') { @@ -1127,8 +1127,7 @@ class ShareAPIController extends OCSController { $share->setPassword($password); } - // only link shares have labels - if ($share->getShareType() === IShare::TYPE_LINK && $label !== null) { + if ($label !== null) { if (strlen($label) > 255) { throw new OCSBadRequestException("Maxmimum label length is 255"); } @@ -1592,7 +1591,6 @@ class ShareAPIController extends OCSController { IShare::TYPE_GROUP, IShare::TYPE_LINK, IShare::TYPE_EMAIL, - IShare::TYPE_EMAIL, IShare::TYPE_CIRCLE, IShare::TYPE_ROOM, IShare::TYPE_DECK |