Add code comment as per Coleman
authorSeamus Lee <seamuslee001@gmail.com>
Sun, 3 Sep 2023 01:07:47 +0000 (11:07 +1000)
committerSeamus Lee <seamuslee001@gmail.com>
Thu, 7 Sep 2023 00:19:10 +0000 (10:19 +1000)
CRM/Contact/BAO/Contact.php

index acff69065cf8680198e7b4ac1706311913e5c31f..f1de7ae4a08c310565e51bb1b41df5592988af33 100644 (file)
@@ -1139,6 +1139,8 @@ WHERE     civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer');
     $cid = $cid ? $cid : $id;
     if ($action & CRM_Core_Action::DELETE) {
       if (CRM_Utils_Request::retrieve('confirmed', 'Boolean')) {
+        // $controller is not used at all but we need the CRM_Core_Controller object as in it's constructor
+        // It retrieves the qfKey from GET or POST and then passes it to CRM_Core_Key::validate the generated key and redirects to a standard error message if fails
         $controller = new CRM_Core_Controller_Simple($formName, ts('New Contact'), NULL, TRUE, FALSE);
         if (!CRM_Contact_BAO_Contact::_checkAccess('Contact', 'update', ['id' => $cid], NULL)) {
           CRM_Utils_System::permissionDenied();