diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2020-05-28 20:29:28 +0200 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2020-05-29 14:42:16 +0200 |
commit | 26e4c292c7284ce6e1e3ddb52ae02123f19482b1 (patch) | |
tree | 894b6e066ccf47a37da03bbe6a1ee75532e5ba09 /lib/private | |
parent | 149d2b00135249c1c84bcf4a134332884528e199 (diff) | |
download | nextcloud-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.php | 6 |
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); |