Merge pull request #26543 from nextcloud/stable19-26433

[stable19] Limit size of properties to 2048 characters
This commit is contained in:
Roeland Jago Douma 2021-04-30 09:28:08 +02:00 committed by GitHub
commit 12aa976b88
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) { public function updateUser(IUser $user, $data) {
$userData = $this->getUser($user); $userData = $this->getUser($user);
$updated = true; $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)) { if (empty($userData)) {
$this->insertNewUser($user, $data); $this->insertNewUser($user, $data);
} elseif ($userData !== $data) { } elseif ($userData !== $data) {