mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +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));
|
throw new SocketException(__('Invalid email: "%s"', $email));
|
||||||
}
|
}
|
||||||
if ($name === null) {
|
if ($name === null) {
|
||||||
$this->{$varName} = array($email => $email);
|
$name = $email;
|
||||||
} else {
|
|
||||||
$this->{$varName} = array($email => $name);
|
|
||||||
}
|
}
|
||||||
|
$this->{$varName} = array($email => $name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$list = array();
|
$list = array();
|
||||||
foreach ($email as $key => $value) {
|
foreach ($email as $key => $value) {
|
||||||
if (is_int($key)) {
|
if (is_int($key)) {
|
||||||
if (!Validation::email($value)) {
|
$key = $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;
|
|
||||||
}
|
}
|
||||||
|
if (!Validation::email($key)) {
|
||||||
|
throw new SocketException(__('Invalid email: "%s"', $key));
|
||||||
|
}
|
||||||
|
$list[$key] = $value;
|
||||||
}
|
}
|
||||||
$this->{$varName} = $list;
|
$this->{$varName} = $list;
|
||||||
}
|
}
|
||||||
|
@ -431,25 +426,20 @@ class CakeEmail {
|
||||||
throw new SocketException(__('Invalid email: "%s"', $email));
|
throw new SocketException(__('Invalid email: "%s"', $email));
|
||||||
}
|
}
|
||||||
if ($name === null) {
|
if ($name === null) {
|
||||||
$this->{$varName}[$email] = $email;
|
$name = $email;
|
||||||
} else {
|
|
||||||
$this->{$varName}[$email] = $name;
|
|
||||||
}
|
}
|
||||||
|
$this->{$varName}[$email] = $name;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$list = array();
|
$list = array();
|
||||||
foreach ($email as $key => $value) {
|
foreach ($email as $key => $value) {
|
||||||
if (is_int($key)) {
|
if (is_int($key)) {
|
||||||
if (!Validation::email($value)) {
|
$key = $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;
|
|
||||||
}
|
}
|
||||||
|
if (!Validation::email($key)) {
|
||||||
|
throw new SocketException(__('Invalid email: "%s"', $key));
|
||||||
|
}
|
||||||
|
$list[$key] = $value;
|
||||||
}
|
}
|
||||||
$this->{$varName} = array_merge($this->{$varName}, $list);
|
$this->{$varName} = array_merge($this->{$varName}, $list);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue