mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Simply the code.
This commit is contained in:
parent
03b4ce070b
commit
30dced741d
1 changed files with 14 additions and 24 deletions
|
@ -375,25 +375,20 @@ class CakeEmail {
|
|||
throw new SocketException(__('Invalid email: "%s"', $email));
|
||||
}
|
||||
if ($name === null) {
|
||||
$this->{$varName} = array($email => $email);
|
||||
} else {
|
||||
$this->{$varName} = array($email => $name);
|
||||
$name = $email;
|
||||
}
|
||||
$this->{$varName} = array($email => $name);
|
||||
return;
|
||||
}
|
||||
$list = array();
|
||||
foreach ($email as $key => $value) {
|
||||
if (is_int($key)) {
|
||||
if (!Validation::email($value)) {
|
||||
throw new SocketException(__('Invalid email: "%s"', $value));
|
||||
}
|
||||
$list[$value] = $value;
|
||||
} else {
|
||||
if (!Validation::email($key)) {
|
||||
throw new SocketException(__('Invalid email: "%s"', $key));
|
||||
}
|
||||
$list[$key] = $value;
|
||||
$key = $value;
|
||||
}
|
||||
if (!Validation::email($key)) {
|
||||
throw new SocketException(__('Invalid email: "%s"', $key));
|
||||
}
|
||||
$list[$key] = $value;
|
||||
}
|
||||
$this->{$varName} = $list;
|
||||
}
|
||||
|
@ -431,25 +426,20 @@ class CakeEmail {
|
|||
throw new SocketException(__('Invalid email: "%s"', $email));
|
||||
}
|
||||
if ($name === null) {
|
||||
$this->{$varName}[$email] = $email;
|
||||
} else {
|
||||
$this->{$varName}[$email] = $name;
|
||||
$name = $email;
|
||||
}
|
||||
$this->{$varName}[$email] = $name;
|
||||
return;
|
||||
}
|
||||
$list = array();
|
||||
foreach ($email as $key => $value) {
|
||||
if (is_int($key)) {
|
||||
if (!Validation::email($value)) {
|
||||
throw new SocketException(__('Invalid email: "%s"', $value));
|
||||
}
|
||||
$list[$value] = $value;
|
||||
} else {
|
||||
if (!Validation::email($key)) {
|
||||
throw new SocketException(__('Invalid email: "%s"', $key));
|
||||
}
|
||||
$list[$key] = $value;
|
||||
$key = $value;
|
||||
}
|
||||
if (!Validation::email($key)) {
|
||||
throw new SocketException(__('Invalid email: "%s"', $key));
|
||||
}
|
||||
$list[$key] = $value;
|
||||
}
|
||||
$this->{$varName} = array_merge($this->{$varName}, $list);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue