From 3405dd0f564f39e4cfff82ef8a7a5fa1385384ce Mon Sep 17 00:00:00 2001 From: Bradley Taylor Date: Sun, 3 Dec 2023 21:45:12 +0000 Subject: [PATCH] [REF][PHP8.2] Declare property in CRM_Admin_Form_ParticipantStatusType --- CRM/Admin/Form/ParticipantStatusType.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CRM/Admin/Form/ParticipantStatusType.php b/CRM/Admin/Form/ParticipantStatusType.php index 7eb9523568..b48b822ff8 100644 --- a/CRM/Admin/Form/ParticipantStatusType.php +++ b/CRM/Admin/Form/ParticipantStatusType.php @@ -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. */ @@ -70,7 +77,7 @@ class CRM_Admin_Form_ParticipantStatusType extends CRM_Admin_Form { 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']); } -- 2.25.1