mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 00:02:54 -04:00
Guard against null phone number value
"parsePhoneNumber()" expects a string, so a TypeError would be thrown if the phone number value is null. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
parent
491c031c0c
commit
3ae1ec4d2a
1 changed files with 3 additions and 0 deletions
|
|
@ -153,6 +153,9 @@ class AccountManager implements IAccountManager {
|
|||
$updated = true;
|
||||
|
||||
if (isset($data[self::PROPERTY_PHONE]) && $data[self::PROPERTY_PHONE]['value'] !== '') {
|
||||
// Sanitize null value.
|
||||
$data[self::PROPERTY_PHONE]['value'] = $data[self::PROPERTY_PHONE]['value'] ?? '';
|
||||
|
||||
try {
|
||||
$data[self::PROPERTY_PHONE]['value'] = $this->parsePhoneNumber($data[self::PROPERTY_PHONE]['value']);
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue