Skip to content

Commit f114e9a

Browse files
RELEASE: 5.0.46
1 parent a329556 commit f114e9a

File tree

15 files changed

+1158
-759
lines changed

15 files changed

+1158
-759
lines changed

CHANGELOG.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## Releases
88

9-
### [5.0.45]
9+
### [5.0.46]
1010

1111
#### Added
1212
- NEW
1313

1414
#### Fixed
15-
- [Dont send address to PayPal if country code is not a 2 character ISO 3166 code (#1947)](https://github.com/eventespresso/cafe/pull/1947)
1615
- FIX
1716

1817
#### Changed
19-
- [Trailing 0 Removed from Ticket Price Calculator (Barista#1426) (#1940)](https://github.com/eventespresso/cafe/pull/1940)
20-
- [REM tickets do not fully retain their state when editing (Barista#1368) (#1942)](https://github.com/eventespresso/cafe/pull/1942)
21-
- [PayPal Commerce - if no country has been set use state iso (#1956)](https://github.com/eventespresso/cafe/pull/1956)
22-
- [Add Post Variable to Events List Event Class Filter (#1960)](https://github.com/eventespresso/cafe/pull/1960)
23-
- [Fix readme and changelog (#1959)](https://github.com/eventespresso/cafe/pull/1959)
18+
- [Add Serialized Model Protection (#1914)](https://github.com/eventespresso/cafe/pull/1914)
19+
- [Improve SessionStartHandler Error Handling (#1967)](https://github.com/eventespresso/cafe/pull/1967)
2420
- MOD
2521

2622
#### Deprecated
@@ -30,7 +26,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3026
- RMV
3127

3228
#### Security
33-
- SEC
29+
- [Fix Model Cap Restriction Generation (#1975)](https://github.com/eventespresso/cafe/pull/1975)
30+
31+
32+
33+
### [5.0.45]
34+
35+
#### Added
36+
- NEW
37+
38+
#### Fixed
39+
- [Dont send address to PayPal if country code is not a 2 character ISO 3166 code (#1947)](https://github.com/eventespresso/cafe/pull/1947)
40+
41+
#### Changed
42+
- [Trailing 0 Removed from Ticket Price Calculator (Barista#1426) (#1940)](https://github.com/eventespresso/cafe/pull/1940)
43+
- [REM tickets do not fully retain their state when editing (Barista#1368) (#1942)](https://github.com/eventespresso/cafe/pull/1942)
44+
- [PayPal Commerce - if no country has been set use state iso (#1956)](https://github.com/eventespresso/cafe/pull/1956)
45+
- [Add Post Variable to Events List Event Class Filter (#1960)](https://github.com/eventespresso/cafe/pull/1960)
46+
- [Fix readme and changelog (#1959)](https://github.com/eventespresso/cafe/pull/1959)
47+
- [Add Serialized Model Protection (#1914)](https://github.com/eventespresso/cafe/pull/1914)
48+
- [Improve SessionStartHandler Error Handling (#1967)](https://github.com/eventespresso/cafe/pull/1967)
49+
50+
#### Security
51+
- [Fix Model Cap Restriction Generation (#1975)](https://github.com/eventespresso/cafe/pull/1975)
3452

3553

3654

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.0.45
1+
5.0.46

caffeinated/core/libraries/messages/message_type/newsletter/EE_Newsletter_message_type.class.php

Lines changed: 37 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ class EE_Newsletter_message_type extends EE_message_type
1414
{
1515
public function __construct()
1616
{
17-
$this->name = 'newsletter';
18-
$this->description = esc_html__(
17+
$this->name = 'newsletter';
18+
$this->description = esc_html__(
1919
'Batch message type messages are triggered manually by the admin for sending notifications to a selected group of recipients. This should only be used for more general notification type messages that contain information specific for the recipients. For "newsletter" type messages we recommend using an email list service like MailChimp, because sending non-related mail-outs to contacts increases the risk of your site domain getting added to spam lists, which will prevent messages getting to users.',
2020
'event_espresso'
2121
);
22-
$this->label = array(
22+
$this->label = [
2323
'singular' => esc_html__('batch', 'event_espresso'),
2424
'plural' => esc_html__('batches', 'event_espresso'),
25-
);
26-
$this->_master_templates = array(
25+
];
26+
$this->_master_templates = [
2727
'email' => 'registration',
28-
);
28+
];
2929

3030
parent::__construct();
3131
}
@@ -36,7 +36,7 @@ public function __construct()
3636
*/
3737
protected function _set_admin_pages()
3838
{
39-
$this->admin_registered_pages = array(); // no admin pages to register this with.
39+
$this->admin_registered_pages = []; // no admin pages to register this with.
4040
}
4141

4242

@@ -45,22 +45,23 @@ protected function _set_admin_pages()
4545
*/
4646
protected function _set_data_handler()
4747
{
48-
$this->_data_handler = 'Registrations';
48+
$this->_data_handler = 'Registrations';
4949
$this->_single_message = $this->_data instanceof EE_Registration;
5050
}
5151

5252

5353
/**
5454
* Returns the data for the given context for this message type.
55+
*
5556
* @param string $context
5657
* @param EE_Registration $registration
5758
* @param int $id
58-
* @return array|mixed
59+
* @return array
5960
*/
6061
protected function _get_data_for_context($context, EE_Registration $registration, $id)
6162
{
6263
// newsletter message type data handler is 'Registrations' and it expects an array of EE_Registration objects.
63-
return array($registration);
64+
return [$registration];
6465
}
6566

6667

@@ -69,7 +70,7 @@ protected function _get_data_for_context($context, EE_Registration $registration
6970
*/
7071
protected function _set_admin_settings_fields()
7172
{
72-
$this->_admin_settings_fields = array();
73+
$this->_admin_settings_fields = [];
7374
}
7475

7576

@@ -78,18 +79,18 @@ protected function _set_admin_settings_fields()
7879
*/
7980
protected function _set_contexts()
8081
{
81-
$this->_context_label = array(
82+
$this->_context_label = [
8283
'label' => esc_html__('recipient', 'event_espresso'),
8384
'plural' => esc_html__('recipients', 'event_espresso'),
8485
'description' => esc_html__('Recipient\'s are who will receive the message.', 'event_espresso'),
85-
);
86+
];
8687

87-
$this->_contexts = array(
88-
'attendee' => array(
88+
$this->_contexts = [
89+
'attendee' => [
8990
'label' => esc_html__('Registrant', 'event_espresso'),
9091
'description' => esc_html__('This template goes to selected registrants.', 'event_espresso'),
91-
),
92-
);
92+
],
93+
];
9394
}
9495

9596

@@ -98,18 +99,18 @@ protected function _set_contexts()
9899
* For the newsletter message type we only have two valid shortcode libraries in use, recipient details and
99100
* organization. That's it!
100101
*
101-
* @since 4.3.0
102102
* @return void
103+
* @since 4.3.0
103104
*/
104105
protected function _set_valid_shortcodes()
105106
{
106107
parent::_set_valid_shortcodes();
107108

108-
$included_shortcodes = array(
109+
$included_shortcodes = [
109110
'recipient_details',
110111
'organization',
111112
'newsletter',
112-
);
113+
];
113114

114115
foreach ($this->_valid_shortcodes as $context => $shortcodes) {
115116
foreach ($shortcodes as $key => $shortcode) {
@@ -128,19 +129,16 @@ protected function _set_valid_shortcodes()
128129
*
129130
* @return array
130131
* @throws EE_Error
131-
* @throws InvalidArgumentException
132132
* @throws ReflectionException
133-
* @throws \EventEspresso\core\exceptions\InvalidDataTypeException
134-
* @throws \EventEspresso\core\exceptions\InvalidInterfaceException
135133
*/
136134
protected function _attendee_addressees()
137135
{
138-
$addressee = array();
136+
$addressee = [];
139137

140138
// looping through registrations
141-
foreach ($this->_data->registrations as $reg_id => $details) {
139+
foreach ($this->_data->registrations as $details) {
142140
// set $attendee array to blank on each loop
143-
$aee = array();
141+
$aee = [];
144142

145143
// need to get the attendee from this registration.
146144
$attendee = isset($details['att_obj']) && $details['att_obj'] instanceof EE_Attendee
@@ -152,25 +150,23 @@ protected function _attendee_addressees()
152150
}
153151

154152
// set $aee from attendee object
155-
$aee['att_obj'] = $attendee;
156-
$aee['reg_objs'] = isset($this->_data->attendees[ $attendee->ID() ]['reg_objs'])
153+
$aee['att_obj'] = $attendee;
154+
$aee['reg_objs'] = isset($this->_data->attendees[ $attendee->ID() ]['reg_objs'])
157155
? $this->_data->attendees[ $attendee->ID() ]['reg_objs']
158-
: array();
156+
: [];
159157
$aee['attendee_email'] = $attendee->email();
160-
$aee['tkt_objs'] = isset($this->_data->attendees[ $attendee->ID() ]['tkt_objs'])
158+
$aee['tkt_objs'] = isset($this->_data->attendees[ $attendee->ID() ]['tkt_objs'])
161159
? $this->_data->attendees[ $attendee->ID() ]['tkt_objs']
162-
: array();
160+
: [];
163161

164162
if (isset($this->_data->attendees[ $attendee->ID() ]['evt_objs'])) {
165163
$aee['evt_objs'] = $this->_data->attendees[ $attendee->ID() ]['evt_objs'];
166-
$aee['events'] = $this->_data->attendees[ $attendee->ID() ]['evt_objs'];
164+
$aee['events'] = $this->_data->attendees[ $attendee->ID() ]['evt_objs'];
167165
} else {
168-
$aee['evt_objs'] = $aee['events'] = array();
166+
$aee['evt_objs'] = $aee['events'] = [];
169167
}
170168

171-
$aee['reg_obj'] = isset($details['reg_obj'])
172-
? $details['reg_obj']
173-
: null;
169+
$aee['reg_obj'] = $details['reg_obj'] ?? null;
174170
$aee['attendees'] = $this->_data->attendees;
175171

176172
// merge in the primary attendee data
@@ -186,6 +182,7 @@ protected function _attendee_addressees()
186182
return $addressee;
187183
}
188184

185+
189186
/**
190187
* Allows a message type to specifically exclude template fields for the provided messenger.
191188
* Filtered so this can be programmatically altered as well.
@@ -195,11 +192,9 @@ protected function _attendee_addressees()
195192
*/
196193
public function excludedFieldsForMessenger($messenger_name)
197194
{
198-
$excluded_fields = array(
199-
'email' => array('cc')
200-
);
201-
return isset($excluded_fields[ $messenger_name ])
202-
? $excluded_fields[ $messenger_name ]
203-
: parent::excludedFieldsForMessenger($messenger_name);
195+
$excluded_fields = [
196+
'email' => ['cc'],
197+
];
198+
return $excluded_fields[ $messenger_name ] ?? parent::excludedFieldsForMessenger($messenger_name);
204199
}
205200
}

0 commit comments

Comments
 (0)