"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Mailer/Message.php" between
cakephp-4.2.2.tar.gz and cakephp-4.2.3.tar.gz

About: CakePHP is a rapid development framework for PHP applications. Source code.

Message.php  (cakephp-4.2.2):Message.php  (cakephp-4.2.3)
skipping to change at line 1856 skipping to change at line 1856
* *
* @return array Serializable array of configuration properties. * @return array Serializable array of configuration properties.
* @throws \Exception When a view var object can not be properly serialized. * @throws \Exception When a view var object can not be properly serialized.
*/ */
public function jsonSerialize(): array public function jsonSerialize(): array
{ {
$properties = [ $properties = [
'to', 'from', 'sender', 'replyTo', 'cc', 'bcc', 'subject', 'to', 'from', 'sender', 'replyTo', 'cc', 'bcc', 'subject',
'returnPath', 'readReceipt', 'emailFormat', 'emailPattern', 'domain' , 'returnPath', 'readReceipt', 'emailFormat', 'emailPattern', 'domain' ,
'attachments', 'messageId', 'headers', 'appCharset', 'charset', 'hea derCharset', 'attachments', 'messageId', 'headers', 'appCharset', 'charset', 'hea derCharset',
'textMessage', 'htmlMessage',
]; ];
$array = []; $array = [];
foreach ($properties as $property) { foreach ($properties as $property) {
$array[$property] = $this->{$property}; $array[$property] = $this->{$property};
} }
array_walk($array['attachments'], function (&$item, $key): void { array_walk($array['attachments'], function (&$item, $key): void {
if (!empty($item['file'])) { if (!empty($item['file'])) {
$item['data'] = $this->readFile($item['file']); $item['data'] = $this->readFile($item['file']);
skipping to change at line 1908 skipping to change at line 1909
array_walk_recursive($array, function (&$item, $key): void { array_walk_recursive($array, function (&$item, $key): void {
if ($item instanceof SimpleXMLElement) { if ($item instanceof SimpleXMLElement) {
$item = json_decode(json_encode((array)$item), true); $item = json_decode(json_encode((array)$item), true);
} }
}); });
return serialize($array); return serialize($array);
} }
/** /**
* Unserializes the Email object. * Unserializes the Message object.
* *
* @param string $data Serialized string. * @param string $data Serialized string.
* @return void * @return void
*/ */
public function unserialize($data) public function unserialize($data)
{ {
$array = unserialize($data); $array = unserialize($data);
if (!is_array($array)) { if (!is_array($array)) {
throw new CakeException('Unable to unserialize message.'); throw new CakeException('Unable to unserialize message.');
} }
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)