[REF][PHP8.2] Declare property in CRM_Admin_Form_ParticipantStatusType
authorBradley Taylor <hello@brad-taylor.co.uk>
Sun, 3 Dec 2023 21:45:12 +0000 (21:45 +0000)
committerBradley Taylor <hello@brad-taylor.co.uk>
Sun, 3 Dec 2023 21:45:12 +0000 (21:45 +0000)
CRM/Admin/Form/ParticipantStatusType.php

index 7eb952356895f5b04702a0da49567102b2387bfb..b48b822ff8cabfb1ccd9227407c9fda053c23b46 100644 (file)
@@ -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']);
     }