fix Mail\Avatar::getLavatar(): Argument #1 ($address) must be of type string, null given

This commit is contained in:
ralf 2023-05-10 14:25:32 +02:00
parent 2f4daa5d39
commit 498aebe192

View File

@ -63,8 +63,12 @@ class Avatar
* - "ralf.becker@egroupware.org" --> dito * - "ralf.becker@egroupware.org" --> dito
* - "rb@egroupware.org" --> ["fname" --> "r", "lname" => "b"] * - "rb@egroupware.org" --> ["fname" --> "r", "lname" => "b"]
*/ */
static function getLavatar(string $address) : array static function getLavatar(string $address=null) : array
{ {
if (empty($address))
{
return [];
}
if (preg_match("/^\"?'?(.*)'?\"?\s+<([^<>'\"]+)>$/", $address, $matches)) if (preg_match("/^\"?'?(.*)'?\"?\s+<([^<>'\"]+)>$/", $address, $matches))
{ {
if (($parts = preg_split('/[, ]+/', $matches[1]))) if (($parts = preg_split('/[, ]+/', $matches[1])))