mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -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
e2c4a174f2
commit
7159a70894
1 changed files with 3 additions and 0 deletions
|
|
@ -134,6 +134,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