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

BMP attachments display warnings #4771

Closed
rcubetrac opened this issue Feb 19, 2015 · 8 comments
Closed

BMP attachments display warnings #4771

rcubetrac opened this issue Feb 19, 2015 · 8 comments

Comments

@rcubetrac
Copy link

Reported by netesa on 19 Feb 2015 07:25 UTC as Trac ticket #1490282

Roundcube assumes .bmp files to have MIME-type image/bmp. However, it is not officially registered at IANA and on many systems it is detected as image/x-ms-bmp. This triggers a warning in Roundcube while trying to open the attachment: "Expected: image/bmp (.bmp); found: image/x-ms-bmp".

Migrated-From: http://trac.roundcube.net/ticket/1490282

@rcubetrac
Copy link
Author

Comment by @alecpl on 19 Feb 2015 07:41 UTC

That might be mime detection related issue, but anyway, I think we could ignore the "conflict" if both expected and found type have "image/" prefix. That should not be a security issue, I suppose.

@rcubetrac
Copy link
Author

Milestone changed by @alecpl on 19 Feb 2015 07:41 UTC

later => 1.1.1

@rcubetrac
Copy link
Author

Comment by @alecpl on 19 Feb 2015 12:45 UTC

Fixed in 4a2a62d.

@rcubetrac
Copy link
Author

Status changed by @alecpl on 19 Feb 2015 12:45 UTC

new => closed

@rcubetrac
Copy link
Author

Comment by netesa on 20 Feb 2015 08:56 UTC

I still observe some problems with BMP files. I'm not quite sure if this is a problem with Roundcube or mime detection issue on my server, however, now the warning is slightly different: "Expected: image/bmp (.bmp); found: image/bmp".

@rcubetrac
Copy link
Author

Comment by @alecpl on 20 Feb 2015 09:11 UTC

Hmm... What if you change the line

$valid_extension = !$file_extension || in_array($file_extension, (array)$extensions); 

to

$valid_extension = !$file_extension || empty($extensions) || in_array($file_extension, (array)$extensions); 

?

@rcubetrac
Copy link
Author

Comment by netesa on 20 Feb 2015 09:15 UTC

With that change it is OK, no warning :)

@rcubetrac
Copy link
Author

Comment by @alecpl on 20 Feb 2015 09:42 UTC

Fixed in 45256e8.

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

No branches or pull requests

1 participant