Skip to content

Commit

Permalink
CIVIWF-3: Fixed file access issue according to new security update in…
Browse files Browse the repository at this point in the history
… CiviCRM.
  • Loading branch information
agilewarealok authored and colemanw committed Aug 13, 2019
1 parent bbf0c50 commit 9bf8318
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion includes/wf_crm_webform_base.inc
Original file line number Diff line number Diff line change
Expand Up @@ -948,10 +948,11 @@ abstract class wf_crm_webform_base {
$entity_id = $this->ent[$entity][$n]['id'];
}
if (!empty($file[$val])) {
$fileHash = CRM_Core_BAO_File::generateFileHash($entity_id, $val);
return array(
'data_type' => 'File',
'name' => CRM_Utils_File::cleanFileName($file[$val]['uri']),
'file_url'=> CRM_Utils_System::url('civicrm/file', "reset=1&id={$val}&eid={$entity_id}", TRUE),
'file_url'=> CRM_Utils_System::url('civicrm/file', "reset=1&id={$val}&eid={$entity_id}&fcs={$fileHash}", TRUE),
'icon' => file_icon_url((object) array('filemime' => $file[$val]['mime_type'])),
);
}
Expand Down

0 comments on commit 9bf8318

Please sign in to comment.