mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Throwing exception when headers is not an array.
This commit is contained in:
parent
77941fb1fb
commit
a92092231c
2 changed files with 5 additions and 2 deletions
|
@ -459,8 +459,8 @@ class CakeSessionException extends CakeException { }
|
|||
class ConfigureException extends CakeException { }
|
||||
|
||||
/**
|
||||
* Exception class for Socket. This exception will be thrown from CakeSocket, HttpSocket and HttpResponse when it
|
||||
* encounters an error.
|
||||
* Exception class for Socket. This exception will be thrown from CakeSocket, CakeEmail, HttpSocket
|
||||
* and HttpResponse when it encounters an error.
|
||||
*
|
||||
* @package cake.libs
|
||||
*/
|
||||
|
|
|
@ -231,6 +231,9 @@ class CakeEmail {
|
|||
* @return void
|
||||
*/
|
||||
public function header($headers) {
|
||||
if (!is_array($headers)) {
|
||||
throw new SocketException(__('$headers should be an array.'));
|
||||
}
|
||||
foreach ($headers as $header => $value) {
|
||||
$this->_header[] = sprintf('%s: %s', trim($header), trim($value));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue