Merge pull request #55982 from nextcloud/backport/55580/stable31

[stable31] fix(files_sharing): Only send password on change
This commit is contained in:
F. E Noel Nfebe 2025-10-30 17:01:22 +01:00 committed by GitHub
commit 3dadf60104
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 27 additions and 14 deletions

View file

@ -1339,10 +1339,13 @@ class ShareAPIController extends OCSController {
$share->setPermissions($permissions);
}
if ($password === '') {
$share->setPassword(null);
} elseif ($password !== null) {
$share->setPassword($password);
$passwordParamSent = $password !== null;
if ($passwordParamSent) {
if ($password === '') {
$share->setPassword(null);
} else {
$share->setPassword($password);
}
}
if ($label !== null) {

View file

@ -320,7 +320,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
}

View file

@ -976,7 +976,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')
}
@ -1139,7 +1143,11 @@ export default {
* "sendPasswordByTalk".
*/
onPasswordProtectedByTalkChange() {
this.queueUpdate('sendPasswordByTalk', 'password')
if (this.isEmailShareType || this.hasUnsavedPassword) {
this.queueUpdate('sendPasswordByTalk', 'password')
} else {
this.queueUpdate('sendPasswordByTalk')
}
},
isValidShareAttribute(value) {
if ([null, undefined].includes(value)) {

2
dist/3798-3798.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/3798-3798.js.map vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/3798-3798.js.map.license vendored Symbolic link
View file

@ -0,0 +1 @@
3798-3798.js.license

2
dist/4003-4003.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
4003-4003.js.license

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long