summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2020-05-28 20:29:28 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2020-05-29 14:42:16 +0200
commit26e4c292c7284ce6e1e3ddb52ae02123f19482b1 (patch)
tree894b6e066ccf47a37da03bbe6a1ee75532e5ba09 /lib/private
parent149d2b00135249c1c84bcf4a134332884528e199 (diff)
downloadnextcloud-server-26e4c292c7284ce6e1e3ddb52ae02123f19482b1.tar.gz
nextcloud-server-26e4c292c7284ce6e1e3ddb52ae02123f19482b1.zip
Fix enabling send password by Talk with empty password in link shares
When "send password by Talk" is enabled in a link share now a non empty password is enforced. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Share20/Manager.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php
index 73860fd39f4..f88d884c0db 100644
--- a/lib/private/Share20/Manager.php
+++ b/lib/private/Share20/Manager.php
@@ -972,8 +972,14 @@ class Manager implements IManager {
} else if ($share->getShareType() === \OCP\Share::SHARE_TYPE_LINK) {
$this->linkCreateChecks($share);
+ $plainTextPassword = $share->getPassword();
+
$this->updateSharePasswordIfNeeded($share, $originalShare);
+ if (empty($plainTextPassword) && $share->getSendPasswordByTalk()) {
+ throw new \InvalidArgumentException('Can’t enable sending the password by Talk with an empty password');
+ }
+
if ($share->getExpirationDate() != $originalShare->getExpirationDate()) {
//Verify the expiration date
$this->validateExpirationDate($share);