Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2020-05-28 21:29:28 +0300
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2020-05-29 15:42:16 +0300
commit26e4c292c7284ce6e1e3ddb52ae02123f19482b1 (patch)
tree894b6e066ccf47a37da03bbe6a1ee75532e5ba09 /lib
parent149d2b00135249c1c84bcf4a134332884528e199 (diff)
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')
-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);