Skip to content

Commit

Permalink
Merge pull request #25217 from braders/profile-image-accept-types
Browse files Browse the repository at this point in the history
Only allow valid image types to be uploaded to image_URL field on profiles
  • Loading branch information
demeritcowboy authored Dec 23, 2022
2 parents 8bfc7a5 + 5f5d7a7 commit 575bb16
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CRM/Core/BAO/UFGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -1894,6 +1894,9 @@ public static function buildProfile(
}
}
elseif (substr($fieldName, 0, 9) === 'image_URL') {
if (!isset($attributes['accept'])) {
$attributes['accept'] = 'image/png, image/jpeg, image/gif';
}
$form->add('file', $name, $title, $attributes, $required);
$form->addUploadElement($name);
}
Expand Down

0 comments on commit 575bb16

Please sign in to comment.