#43861 closed defect (bug) (invalid)
Administrator cannot upload .cpp file to mediafiles
Reported by: | acbaile | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Media | Keywords: | |
Focuses: | Cc: |
Description
My account is first in installation and I see in the list of users that role is Administrator. But I cannot upload .cpp file. I see: "this file type is not permitted for security reasons". I cannot change it - I cannot find this setting on user page. So, why is it? And how to fix?
Change History (4)
#1
follow-ups:
↓ 2
↓ 3
↓ 4
@
7 years ago
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
- Version 4.9.5 deleted
#2
in reply to:
↑ 1
@
7 years ago
Replying to desrosj:
.cpp
files are not in the list of file types that WordPress allows to be uploaded by default.
There is no setting to enable this,
Why? I see in the code following parts of code:
case 'unfiltered_upload': current_user_can( 'unfiltered_upload' ) function populate_roles_230() { $role = get_role( 'administrator' ); if ( !empty( $role ) ) { $role->add_cap( 'unfiltered_upload' ); } }
It seems, this function was present in the past. Why did this possibility disappear?
It is inconvenience.
Note: See
TracTickets for help on using
tickets.
Hi @acbaile, thanks for the ticket!
.cpp
files are not in the list of file types that WordPress allows to be uploaded by default.There is no setting to enable this, but it could be allowed using the
mime_types
filter (https://core.trac.wordpress.org/browser/tags/4.9.5/src/wp-includes/functions.php#L2413).Make sure you give proper consideration to the file type you are whitelisting, and who you are allowing to upload.