Merge pull request #26525 from nextcloud/backport/26433/stable21
[stable21] Limit size of properties to 2048 characters
This commit is contained in:
commit
385420c64f
|
@ -144,6 +144,17 @@ class AccountManager implements IAccountManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set a max length
|
||||||
|
foreach ($data as $propertyName => $propertyData) {
|
||||||
|
if (isset($data[$propertyName]) && isset($data[$propertyName]['value']) && strlen($data[$propertyName]['value']) > 2048) {
|
||||||
|
if ($throwOnData) {
|
||||||
|
throw new \InvalidArgumentException($propertyName);
|
||||||
|
} else {
|
||||||
|
$data[$propertyName]['value'] = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$allowedScopes = [
|
$allowedScopes = [
|
||||||
self::SCOPE_PRIVATE,
|
self::SCOPE_PRIVATE,
|
||||||
self::SCOPE_LOCAL,
|
self::SCOPE_LOCAL,
|
||||||
|
|
Loading…
Reference in New Issue