Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict allowed uploads - contact image #23147

Merged
merged 1 commit into from
Apr 22, 2022

Conversation

braders
Copy link
Contributor

@braders braders commented Apr 9, 2022

Overview

Restrict allowed uploads - contact image

Before

The image upload for contacts accepted any file type. However, server-side logic restricted this within CRM_Contact_BAO_Contact::processImageParams.

After

Only allowed file types are allowed.

Comments

CRM_Contact_BAO_Contact::processImageParams actually accepts image/bmp, as well as aliases like image/x-png. All modern browsers will understand the accept value I have defined, and I really can't see anyone wanting to upload a bmp image in 2022! Therefore I went for a simplified list of mime types.

@civibot
Copy link

civibot bot commented Apr 9, 2022

(Standard links)

@civibot civibot bot added the master label Apr 9, 2022
@demeritcowboy
Copy link
Contributor

This seems fine. There's a weird spacing in the error box if you try to upload a wrong file but I don't know where that popup is coming from and seems like a more general issue. P.S. I tried uploading this screenshot as a bmp but github won't take it (grin).

Untitled2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants