Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions apps/files_sharing/lib/Controller/ShareAPIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1342,10 +1342,13 @@ public function updateShare(
$share->setPermissions($permissions);
}

if ($password === '') {
$share->setPassword(null);
} elseif ($password !== null) {
$share->setPassword($password);
$passwordParamSent = $this->request->getParam('password') !== null;
if ($passwordParamSent) {
if ($password === '') {
$share->setPassword(null);
} else {
$share->setPassword($password);
}
}

if ($label !== null) {
Expand Down
4 changes: 3 additions & 1 deletion apps/files_sharing/src/mixins/SharesMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,9 @@ export default {
// share api controller accepts
for (const name of propertyNames) {
if (name === 'password') {
properties[name] = this.share.newPassword ?? this.share.password
if (this.share.newPassword !== undefined) {
properties[name] = this.share.newPassword
}
continue
}

Expand Down
12 changes: 10 additions & 2 deletions apps/files_sharing/src/views/SharingDetailsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,11 @@ export default {

async saveShare() {
const permissionsAndAttributes = ['permissions', 'attributes', 'note', 'expireDate']
const publicShareAttributes = ['label', 'password', 'hideDownload']
const publicShareAttributes = ['label', 'hideDownload']
// Only include password if it's being actively changed
if (this.hasUnsavedPassword) {
publicShareAttributes.push('password')
}
if (this.config.allowCustomTokens) {
publicShareAttributes.push('token')
}
Expand Down Expand Up @@ -1220,7 +1224,11 @@ export default {
* "sendPasswordByTalk".
*/
onPasswordProtectedByTalkChange() {
this.queueUpdate('sendPasswordByTalk', 'password')
if (this.isEmailShareType || this.hasUnsavedPassword) {
this.queueUpdate('sendPasswordByTalk', 'password')
} else {
this.queueUpdate('sendPasswordByTalk')
}
},

isValidShareAttribute(value) {
Expand Down
Loading