Skip to content
Snippets Groups Projects
Commit ad91f39c authored by Lukas Reschke's avatar Lukas Reschke Committed by backportbot[bot]
Browse files

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: default avatarLukas Reschke <lukas@statuscode.ch>
parent 87212ab0
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment