Limit size of properties to 2048 characters
It is unreasonable to expect that one of these fields would be longer than 2048 characters. Whilst some have definitely lower limits (such as for phone numbers or domain names), a upper bound as sanity check makes sense. Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
parent
365569f51c
commit
2befac662c
|
@ -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 = [
|
||||
self::SCOPE_PRIVATE,
|
||||
self::SCOPE_LOCAL,
|
||||
|
|
Loading…
Reference in New Issue