Skip to content

Commit

Permalink
Merge pull request civicrm#28457 from braders/php8-ParticipantStatusType
Browse files Browse the repository at this point in the history
[REF][PHP8.2] Declare property in CRM_Admin_Form_ParticipantStatusType
  • Loading branch information
eileenmcnaughton authored Dec 3, 2023
2 parents 9b97846 + 3405dd0 commit 3b1d1fe
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion CRM/Admin/Form/ParticipantStatusType.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ class CRM_Admin_Form_ParticipantStatusType extends CRM_Admin_Form {
*/
public $submitOnce = TRUE;

/**
* Used to make sure a malicious POST does not change is_reserved
*
* @var bool
*/
protected $_isReserved = FALSE;

/**
* Explicitly declare the entity api name.
*/
Expand Down Expand Up @@ -70,7 +77,7 @@ public function setDefaultValues() {
if (empty($defaults['weight'])) {
$defaults['weight'] = CRM_Utils_Weight::getDefaultWeight('CRM_Event_DAO_ParticipantStatusType');
}
$this->_isReserved = $defaults['is_reserved'] ?? NULL;
$this->_isReserved = $defaults['is_reserved'] ?? FALSE;
if ($this->_isReserved) {
$this->freeze(['name', 'class', 'is_active']);
}
Expand Down

0 comments on commit 3b1d1fe

Please sign in to comment.