Merge pull request #26542 from nextcloud/stable20-26433

[stable20] Limit size of properties to 2048 characters
This commit is contained in:
Roeland Jago Douma 2021-04-30 09:27:45 +02:00 committed by GitHub
commit 31b6443091
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -93,6 +93,14 @@ class AccountManager implements IAccountManager {
public function updateUser(IUser $user, $data) {
$userData = $this->getUser($user);
$updated = true;
// set a max length
foreach ($data as $propertyName => $propertyData) {
if (isset($data[$propertyName]) && isset($data[$propertyName]['value']) && strlen($data[$propertyName]['value']) > 2048) {
$data[$propertyName]['value'] = '';
}
}
if (empty($userData)) {
$this->insertNewUser($user, $data);
} elseif ($userData !== $data) {